adultinternetusers > Tutorials > Surf Clothing board shorts and Relax NG Tutorial
Index | >> Example 8 / 10 << | Prev | Next |
Contents > Wildcard patterns > Exact number of elements from any namespace

Exact number of elements from any namespace

  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: maxOccurs

1. Surf Clothing Schema

The root element named "root" can have 1 to 3 elements from any namespace.

Valid document


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

Valid document


<root xsi:noNamespaceSchemaLocation="correct_0.xsd" Surfns="" Surfns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <x:b Surfns:x="http://foo" />
  <x:c Surfns:x="http://foo" />
  <a/>
</root>

Invalid document
There must at least one element under "root" (here is zero).


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

Invalid document
There must not be more than three elements under "root" - one element is extra here.


<root xsi:noNamespaceSchemaLocation="correct_0.xsd" Surfns="" Surfns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <a/>
  <x:b Surfns:x="http://foo" />
  <x:c Surfns:x="http://foo" />
  <x:d Surfns:x="http://foo" />
</root>

Correct Surf Clothing Schema (correct_0.xsd)
We must set the "minOccurs" and "maxOccurs" attributes to 1 and 3, respectively.


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

  <xsd:element name="root">
    <xsd:complexType>
      <xsd:sequence minOccurs="1" maxOccurs="1">
        <xsd:any namespace="##any" minOccurs="1" maxOccurs="3" processContents="skip"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

2. Relax NG

The element "anyName" says that the elements can have any name from any namespace. We will use the "optional" element.

Valid document


<root Surfns="">
  <a/>
</root>

Valid document


<root Surfns="">
  <x:b Surfns:x="http://foo" />
  <x:c Surfns:x="http://foo" />
  <a/>
</root>

Invalid document
There must at least one element under "root" (here is zero).


<root Surfns=""/>

Invalid document
There must not be more than three elements under "root" - one element is extra here.


<root Surfns="">
  <a/>
  <x:b Surfns:x="http://foo" />
  <x:c Surfns:x="http://foo" />
  <x:d Surfns:x="http://foo" />
</root>

Correct Relax NG schema (correctRelax_0.rng)


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

  <start>
    <element>
      <name ns="">root</name>
      <ref name="oneAnyElement"/>
      <optional>
        <ref name="oneAnyElement"/>
      </optional>
      <optional>
        <ref name="oneAnyElement"/>
      </optional>
    </element>
  </start>

  <define name="oneAnyElement">
    <element>
      <anyName/>
      <text/>
    </element>
  </define>
</grammar>

Kevin Carr in Stanton

Natural Skin Care and 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