Test results for Linux

test_004063_xsd_multitree_4

Test description

Test for element sequence number handling, wildcard handling, and
hierarchical element handling with element records that have more
than one structure in a complex XSD schema. This test also ensures
the element helpers are working.

Test status

 Pass

Run command

cat _INPUT_DATA_ ¦ xmlfy -S schema.xsd -A1 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
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 7 8 9 10 11 12
1 2 3 4 5 6 7 8 9 10 11 12 13
1 2 3 4 5 6 7 8 9 10 11 12 13 14
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

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="multitree">
    <xs:sequence>
      <xs:element name="line_eg" type="egType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:element>
  <xs:complexType name="egType">
    <xs:choice>
      <xs:element name="c" type="xs:string" />
      <xs:sequence>
        <xs:element name="line_eg1" type="eg1Type" />
        <xs:element name="b" type="xs:string" />
        <xs:element name="c" type="xs:string" />
        <xs:element name="line_eg2" type="eg2Type" />
      </xs:sequence>
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="eg1Type">
    <xs:choice>
      <xs:element name="b" type="xs:string" />
      <xs:sequence>
        <xs:element name="line_eg1_1" type="eg1_1Type" />
        <xs:element name="b" type="xs:string" />
      </xs:sequence>
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="eg1_1Type">
    <xs:choice>
      <xs:element name="b" type="xs:string" />
      <xs:element name="c" type="xs:string" />
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="eg2Type">
    <xs:choice>
      <xs:sequence>
        <xs:element name="line_eg2_1" type="eg2_1Type" />
        <xs:element name="a" type="xs:string" />
      </xs:sequence>
      <xs:sequence>
        <xs:element name="line_eg2_2" type="eg2_2Type" />
        <xs:element name="a" type="xs:string" />
      </xs:sequence>
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="eg2_1Type">
    <xs:choice>
      <xs:element name="a" type="xs:string" />
      <xs:element name="b" type="xs:string" />
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="eg2_2Type">
    <xs:choice>
      <xs:element name="a" type="xs:string" />
      <xs:sequence>
        <xs:element name="line_eg2_2_1" type="eg2_2_1Type" />
        <xs:element name="b" type="xs:string" />
      </xs:sequence>
      <xs:element name="b" type="xs:string" />
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="eg2_2_1Type">
    <xs:choice>
      <xs:element name="b" type="xs:string" />
      <xs:element name="c" type="xs:string" />
    </xs:choice>
  </xs:complexType>
</xs:schema>

Output result

<?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_eg number="1">
    <c>1</c>
  </line_eg>
  <line_eg number="2">
    <line_eg1>
      <b>1</b>
    </line_eg1>
    <b>2</b>
    <c>3</c>
    <line_eg2>
      <line_eg2_1>
        <a>4</a>
      </line_eg2_1>
      <a>5</a>
    </line_eg2>
  </line_eg>
  <line_eg number="3">
    <line_eg1>
      <b>1</b>
    </line_eg1>
    <b>2</b>
    <c>3</c>
    <line_eg2>
      <line_eg2_2>
        <line_eg2_2_1>
          <b>4</b>
        </line_eg2_2_1>
        <b>5</b>
      </line_eg2_2>
      <a>6</a>
    </line_eg2>
  </line_eg>
  <line_eg number="4">
    <line_eg1>
      <line_eg1_1>
        <b>1</b>
      </line_eg1_1>
      <b>2</b>
    </line_eg1>
    <b>3</b>
    <c>4</c>
    <line_eg2>
      <line_eg2_2>
        <line_eg2_2_1>
          <b>5</b>
        </line_eg2_2_1>
        <b>6</b>
      </line_eg2_2>
      <a>7</a>
    </line_eg2>
  </line_eg>
</multitree>

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