January 20, 2012 at 4:24 am
Hi everyone
I have a question about XML and XSD.
In my XML file there are repeating elements. I have normalised the XML into several tables, but now I want to use SSIS/Bulk XML Load to import the data to improve load speeds etc.
The problem I have is to specify that the record reference should be used for each repeating "table" element in the XSD.
For example, if this is my XML:
<Product>
<RecordReference>0001</RecordReference>
<ProductForm>BB</ProductForm>
<Title>
<TitleType>01</TitleType>
<TitleText>Normandy before 1066</TitleText>
</Title>
<Contributor>
<SequenceNumber>1</SequenceNumber>
<PersonName>Professor David Bates</PersonName>
</Contributor>
<Contributor>
<SequenceNumber>2</SequenceNumber>
<PersonName>Professor J de Wet</PersonName>
</Contributor>
</Product>
I have a table called Contributor, with the RecordReference, SequenceNumber and PersonName fields.
So how would I change the XSD to "include" the RecordReference in the Contributor element?
<xs:element minOccurs="0" maxOccurs="unbounded" name="Product">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="RecordReference" type="xs:unsignedLong" />
<xs:element minOccurs="0" name="ProductForm" type="xs:string" />
<xs:element minOccurs="0" name="Contributor" Reference to RecordReference here>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="SequenceNumber" type="xs:unsignedByte" />
<xs:element minOccurs="0" name="PersonName" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:complexType>
</xs:element>
any ideas?
Thanks
January 23, 2012 at 11:46 pm
sorry for the bump, but I would really like to find a solution for this.
There has to be a way that I can make the recordreference part of contributor element through the XSD?
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply