I have some XML files that I need to batch process into SQL Server. The following Schema and XML sections outline an area I'm having trouble with.
<xs:complexType>
<xs:sequence>
<xs:choice maxOccurs="unbounded">
<xs:element name="TextLine" type="xs:string" sql:field="AdvertLine" sql:relation="XmlAdvert" sql:relationship="XmlAdvert" />
<xs:element name="BreakPoint" sql:is-constant="1" />
</xs:choice>
</xs:sequence>
</xs:complexType>
<Advert>
<AdvertText>
<TextLine>Isuzu 4 X 4TRUCKMAN</TextLine>
<BreakPoint />
<TextLine>2.0TD, Red, 5 dr, 60,000 miles, MOT, 5 SEATER</TextLine>
<BreakPoint />
<TextLine>£2500</TextLine>
<BreakPoint />
<TextLine>01234 567890</TextLine>
</AdvertText>
</Advert>
But since xs:choice isn't supported in SQLXMLBulkload I wondered if there was another way of representing this as without the xs:choice section the xs:sequence is invalid as soon as it hits the second TextLine.