Test results for Solaris x86

test_004060_xsd_multitree_1

Test description

Test for hierarchical element handling in a XSD schema.

Test status

 Pass

Run command

cat _INPUT_DATA_ ¦ xmlfy -S schema.xsd -A number

Input data

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

Schema

<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="command">
    <xs:choice>
      <xs:element name="line_a" type="aType" />
      <xs:element name="line_b" type="bType" />
    </xs:choice>
  </xs:element>
  <xs:complexType name="aType">
    <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:complexType>
  <xs:complexType name="bType">
    <xs:sequence>
      <xs:element name="b" type="xs:string" />
      <xs:element name="c" type="xs:string" />
      <xs:element ref="line_a" />
      <xs:element name="d" type="xs:string" />
    </xs:sequence>
  </xs:complexType>
</xs:schema>

Output result

<?xml version="1.0" encoding="UTF-8"?>
<command xmlns="http://xmlfy.sourceforge.net"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://xmlfy.sourceforge.net schema.xsd">
  <line_a number="1">
    <a number="1">1</a>
    <b number="1">2</b>
    <c number="1">3</c>
  </line_a>
  <line_b number="1">
    <b number="1">1</b>
    <c number="1">2</c>
    <line_a number="1">
      <a number="1">3</a>
      <b number="1">4</b>
      <c number="1">5</c>
    </line_a>
    <d number="1">6</d>
  </line_b>
</command>

Goto:   Top of page.   Section "Environment".   Section "Summary".   Section "Test cases".