cancel
Showing results for 
Search instead for 
Did you mean: 

xsd Schema actually allows as a valid XML file

Former Member
0 Kudos

Find the generated example based on the xsd Schema actually allows as a valid XML file. I am bit confused as why there is SampleRecord for each DetailRecord I think it make more sense if SampleRecord was at the same level as Header record.

With regards to the SampleRecord and the RecordType as they are now, if there are 5 DetailRecords 3 of which are type A and 2 are type B should the sample records for a type B record be

<SampleRecord>

<RecordType>A</RecordType>

<TotalRecords>3</TotalRecords>

</SampleRecord>

and

<SampleRecord>

<RecordType>B</RecordType>

<TotalRecords>2</TotalRecords>

</SampleRecord>

R we generating the correct file?

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

could you past compete XSD , i beleive sample record occurence 1 ti unbounded hance it is allowing mutiple records.

Answers (1)

Answers (1)

Former Member
0 Kudos

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://CostCentre1" targetNamespace="http://CostCentre1">

<xsd:complexType name="CostCn_Dt_Ob">

<xsd:sequence>

<xsd:element name="HeaderRecord">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="RecordType" type="xsd:string" />

<xsd:element name="Date" type="xsd:string" />

<xsd:element name="Time" type="xsd:string" />

<xsd:element name="DetailRecord" minOccurs="0" maxOccurs="unbounded">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="RecordType" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />

<xsd:element name="CompanyCode" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />

<xsd:element name="CostCentre" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />

<xsd:element name="Department" type="xsd:string" />

<xsd:element name="ControlArea" type="xsd:string" />

<xsd:element name="PersonResposible" type="xsd:string" />

<xsd:element name="EndDate" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />

<xsd:element name="StartDate" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />

<xsd:element name="LongText" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />

<xsd:element name="ShortText" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />

<xsd:element name="Name1" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />

<xsd:element name="Name2" type="xsd:string" />

<xsd:element name="Name3" type="xsd:string" />

<xsd:element name="Name4" type="xsd:string" />

<xsd:element name="Street" type="xsd:string" />

<xsd:element name="Location" type="xsd:string" />

<xsd:element name="District" type="xsd:string" />

<xsd:element name="City" type="xsd:string" />

<xsd:element name="Region" type="xsd:string" />

<xsd:element name="Postal_Code" type="xsd:string" />

<xsd:element name="Language_Key" type="xsd:string" />

<xsd:element name="Telephone1" type="xsd:string" />

<xsd:element name="Telephone2" type="xsd:string" />

<xsd:element name="Telebox_number" type="xsd:string" />

<xsd:element name="TrailerRecord" minOccurs="0" maxOccurs="unbounded">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="RecordType" type="xsd:string" />

<xsd:element name="TotalRecords" type="xsd:string" />

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>