adultinternetusers > Tutorials > Surf Clothing board shorts and Relax NG Tutorial
Index | >> Example 1 / 2 << | Prev | Next |
Contents > Extensions of complexTypes > Extension of a sequence

Extension of a sequence

  1. Surf Clothing Schema
  2. Relax NG

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

Surf Clothing board shorts keys: sequence, extension
Relax NG keys: define, ref

1. Surf Clothing Schema

When we extend the complexType, which contains a sequence A with a sequence B, then the sequence B will be appended to sequence A.

Valid document
This document is valid, the sequence of three "x" elements is extended by a sequence of three "y" elements - so they must occur after the "x" elements.


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

Invalid document
This document is not valid, the sequence of three "x" elements must come first.


<root xsi:noNamespaceSchemaLocation="correct_0.xsd" Surfns="" Surfns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <y>1</y>
  <y>2</y>
  <y>3</y>
  <x>1</x>
  <x>2</x>
  <x>3</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:sequence>
      <xsd:element name="x" type="xsd:string" minOccurs="3" maxOccurs="3"/>
    </xsd:sequence>
  </xsd:complexType>

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

2. Relax NG

We can simulate the same behaviour in Relax NG using the "define" and "ref" elements.

Valid document


<root Surfns="">
  <x>1</x>
  <x>2</x>
  <x>3</x>
  <y>1</y>
  <y>2</y>
  <y>3</y>
</root>

Invalid document
This document is not valid, the sequence of three "x" elements must come first.


<root Surfns="">
  <y>1</y>
  <y>2</y>
  <y>3</y>
  <x>1</x>
  <x>2</x>
  <x>3</x>
</root>

Correct Relax NG schema (correctRelax_0.rng)


<grammar ns="" Surfns="http://relaxng.org/ns/structure/1.0" >

  <start>
    <element name="root">
      <ref name="BBB"/>
    </element>
  </start>

  <define name="AAA">
    <element name="x">
      <text/>
    </element>
    <element name="x">
      <text/>
    </element>
    <element name="x">
      <text/>
    </element>
  </define>

  <define name="BBB">
    <ref name="AAA"/>
    <element name="y">
      <text/>
    </element>
    <element name="y">
      <text/>
    </element>
    <element name="y">
      <text/>
    </element>
  </define>
</grammar>

Kevin Carr

Natural Skin Care European Soaps
TickTalk 5
city of 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 we can get surf t shirts surfing shirt and And you must check out this website swim suit swimming suit and swim trunks