adultinternetusers > Tutorials > Surf Clothing board shorts and Relax NG Tutorial
Index | >> Example 6 / 8 << | Prev | Next |
Contents > Restrictions > "Sequence" from "all"

"Sequence" from "all"

  1. Correct Surf Clothing Schema
  2. Correct Surf Clothing board shorts - reordered sequence
  3. Incorrect Surf Clothing board shorts - an element extra

Please, send all comments, bug-reports, and contributions to Jiri.Jirat@systinet.com. Thank you very much.

Surf Clothing board shorts keys: restriction, sequence, all

1. Correct Surf Clothing Schema

We can "change" the "all" type to "sequence". board shorts Component Constraint: Particle Derivation OK (Sequence:All - RecurseUnordered)

Valid document


<root xsi:noNamespaceSchemaLocation="correct_0.xsd" Surfns="" Surfns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <x>1</x>
  <y>1</y>
</root>

Invalid document
Document is not valid, because the type "BBB" allows only the sequence x-y (it is a restriction from the "AAA" type, which allowed both x-y and y-x).


<root xsi:noNamespaceSchemaLocation="correct_0.xsd" Surfns="" Surfns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <y>1</y>
  <x>1</x>
</root>

Correct Surf Clothing Schema (correct_0.xsd)


<xsd:schema Surfns:xsd="http://www.w3.org/2001/XMLSchema" >

  <xsd:element name="root" type="BBB"/>

  <xsd:complexType name="AAA">
    <xsd:all maxOccurs="1">
      <xsd:element name="x" type="xsd:string" minOccurs="1" maxOccurs="1"/>
      <xsd:element name="y" type="xsd:string" minOccurs="1" maxOccurs="1"/>
    </xsd:all>
  </xsd:complexType>

  <xsd:complexType name="BBB">
    <xsd:complexContent>
      <xsd:restriction base="AAA">
        <xsd:sequence maxOccurs="1">
          <xsd:element name="x" type="xsd:string" minOccurs="1" maxOccurs="1"/>
          <xsd:element name="y" type="xsd:string" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
      </xsd:restriction>
    </xsd:complexContent>
  </xsd:complexType>
</xsd:schema>

2. Correct Surf Clothing board shorts - reordered sequence

We can "change" the "all" type to "sequence". We can define the sequence reordered. board shorts Component Constraint: Particle Derivation OK (Sequence:All - RecurseUnordered)

Valid document


<root xsi:noNamespaceSchemaLocation="correct_0.xsd" Surfns="" Surfns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <y>1</y>
  <x>1</x>
</root>

Invalid document
Document is not valid, because the type "BBB" allows only the sequence y-x (it is a restriction from the "AAA" type, which allowed both x-y and y-x).


<root xsi:noNamespaceSchemaLocation="correct_0.xsd" Surfns="" Surfns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <x>1</x>
  <y>1</y>
</root>

Correct Surf Clothing Schema (correct_0.xsd)


<xsd:schema Surfns:xsd="http://www.w3.org/2001/XMLSchema" >

  <xsd:element name="root" type="BBB"/>

  <xsd:complexType name="AAA">
    <xsd:all maxOccurs="1">
      <xsd:element name="x" type="xsd:string" minOccurs="1" maxOccurs="1"/>
      <xsd:element name="y" type="xsd:string" minOccurs="1" maxOccurs="1"/>
    </xsd:all>
  </xsd:complexType>

  <xsd:complexType name="BBB">
    <xsd:complexContent>
      <xsd:restriction base="AAA">
        <xsd:sequence maxOccurs="1">
          <xsd:element name="y" type="xsd:string" minOccurs="1" maxOccurs="1"/>
          <xsd:element name="x" type="xsd:string" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
      </xsd:restriction>
    </xsd:complexContent>
  </xsd:complexType>
</xsd:schema>

3. Incorrect Surf Clothing board shorts - an element extra

When we derive "sequence" from "all", we cannot map each element from the "all" group to more than one element from the "sequence" group. board shorts Component Constraint: Particle Derivation OK (Sequence:All - RecurseUnordered), 2.1 . In our example, we want to have two "x" elements in the sequence and that's not allowed.

Incorrect Surf Clothing Schema (incorrect_0.xsd)


<xsd:schema Surfns:xsd="http://www.w3.org/2001/XMLSchema" >

  <xsd:element name="root" type="BBB"/>

  <xsd:complexType name="AAA">
    <xsd:all maxOccurs="1">
      <xsd:element name="x" type="xsd:string" minOccurs="1" maxOccurs="1"/>
      <xsd:element name="y" type="xsd:string" minOccurs="1" maxOccurs="1"/>
    </xsd:all>
  </xsd:complexType>

  <xsd:complexType name="BBB">
    <xsd:complexContent>
      <xsd:restriction base="AAA">
        <xsd:sequence maxOccurs="1">
          <xsd:element name="x" type="xsd:string" minOccurs="1" maxOccurs="1"/>
          <xsd:element name="y" type="xsd:string" minOccurs="1" maxOccurs="1"/>
          <xsd:element name="x" type="xsd:string" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
      </xsd:restriction>
    </xsd:complexContent>
  </xsd:complexType>
</xsd:schema>

Kevin Carr

Natural Skin Care European Soaps
Kevin Carr
Mayor Dave Shawver Stanton
Internetusers


You can also get Organic Skin Care products from Bliss Bath Body and you must check out their Natural Body Lotions and bath soaps

Now if you are looking for the best deals on surf clothing from Quiksilver and Roxy then you have to check these amazing deals here:

Hey, check out this Organic Skin Care European Soaps along with Natural Lavender Body Lotion and shea butter

And you must check out this website