Test results for Linux |
Test for hierarchical element handling with element records that have more than one structure in a XSD schema.
Pass
cat _INPUT_DATA_ ¦ xmlfy -S schema.xsd -A number
1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 5 6 1 2 3 4 5 6 7 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 9
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xmlfy.sourceforge.net"
xmlns="http://xmlfy.sourceforge.net"
elementFormDefault="qualified">
<xs:element name="multitree">
<xs:choice>
<xs:element name="line_a" type="aType" />
<xs:element name="line_b" type="bType" />
<xs:element name="line_b" type="bType" />
<xs:element name="line_a" type="aType" />
<xs:element name="line_b" type="bType" />
<xs:element name="line_b" type="bType" />
<xs:element name="line_a" type="aType" />
</xs:choice>
</xs:element>
<xs:complexType name="aType">
<xs:choice>
<xs:sequence>
<xs:element name="b" type="xs:string" />
<xs:element name="c" type="xs:string" />
</xs:sequence>
<xs:sequence>
<xs:element name="b" type="xs:string" />
<xs:element name="c" type="xs:string" />
<xs:element ref="line_b" />
<xs:element name="c" type="xs:string" />
</xs:sequence>
</xs:choice>
</xs:complexType>
<xs:complexType name="bType">
<xs:choice>
<xs:sequence>
<xs:element name="a" type="xs:string" />
<xs:element name="b" type="xs:string" />
<xs:element name="c" type="xs:string" />
</xs:sequence>
<xs:element name="d" type="xs:string" />
</xs:choice>
</xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<multitree xmlns="http://xmlfy.sourceforge.net"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlfy.sourceforge.net schema.xsd">
<line_b number="1">
<d number="1">1</d>
</line_b>
<line_a number="1">
<b number="1">1</b>
<c number="1">2</c>
</line_a>
<line_b number="2">
<a number="1">1</a>
<b number="1">2</b>
<c number="1">3</c>
</line_b>
<line_a number="2">
<b number="1">1</b>
<c number="1">2</c>
<line_b number="1">
<d number="1">3</d>
</line_b>
<c number="2">4</c>
</line_a>
<line_a number="3">
<b number="1">1</b>
<c number="1">2</c>
<line_b number="1">
<a number="1">3</a>
<b number="1">4</b>
<c number="1">5</c>
</line_b>
<c number="2">6</c>
</line_a>
</multitree>