A
Arthur
I've come across some strange xml, that I need to deal with, it looks
like this:-
<root>
<foo attr="1">Some random strange text.
<bar attr="2">blar</bar>
<bar attr="3">blar blar</bar>
<bar attr="4">blar blar blar</bar>
</foo>
</root>
Its the 'Some random strange text' in the between the foo tags along
with all the bar tags.
First of all, if the above actually legal well formed XML?
And if so, what would some schema look like to validate it?
I've tried something similar to this:-
....
<xs:element name="foo">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="attr" type="xs:int" use="required"/>
</xs:extension>
</xs:simpleContent>
<xs:choice>
<xs:element name="bar" minOccurs="0">
<xs:complexType>
<xs:attribute name="attr" type="xs:int" use="required"/>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
....
Buts this doesn't work.
Anyone got any ideas?
Arthur.
like this:-
<root>
<foo attr="1">Some random strange text.
<bar attr="2">blar</bar>
<bar attr="3">blar blar</bar>
<bar attr="4">blar blar blar</bar>
</foo>
</root>
Its the 'Some random strange text' in the between the foo tags along
with all the bar tags.
First of all, if the above actually legal well formed XML?
And if so, what would some schema look like to validate it?
I've tried something similar to this:-
....
<xs:element name="foo">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="attr" type="xs:int" use="required"/>
</xs:extension>
</xs:simpleContent>
<xs:choice>
<xs:element name="bar" minOccurs="0">
<xs:complexType>
<xs:attribute name="attr" type="xs:int" use="required"/>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
....
Buts this doesn't work.
Anyone got any ideas?
Arthur.