adultinternetusers > Tutorials > Surf Clothing board shorts and Relax NG Tutorial
Index | >> Example 3 / 10 << | Prev | Next |
Contents > Simple types > Multiple restrictions

Multiple restrictions

  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: union, minInclusive, maxInclusive
Relax NG keys: choice, param

1. Surf Clothing Schema

Now, we want the element "root" to be from the range 0-100 or 300-400 (including the border values). We will make a union from two intervals.

Valid document
Value is from interval 0-100.


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

Valid document
Value is from interval 300-400.


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

Invalid document
The value does not fall in the interval 0-100 neither 300-400.


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

Correct Surf Clothing Schema (correct_0.xsd)


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

  <xsd:element name="root">
    <xsd:simpleType>
      <xsd:union>
        <xsd:simpleType>
          <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="100"/>
          </xsd:restriction>
        </xsd:simpleType>
        <xsd:simpleType>
          <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="300"/>
            <xsd:maxInclusive value="400"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:union>
    </xsd:simpleType>
  </xsd:element>
</xsd:schema>

2. Relax NG

As far as I know, such complex derivations are not possible in Relax NG. However, we can overcome this using the "choice" element. And this should be the same - logical OR corresponds to operation "union".

Valid document
Value is from interval 0-100.


<root Surfns="">50</root>

Valid document
Value is from interval 300-400.


<root Surfns="">380</root>

Invalid document
The value does not fall in the interval 0-100 neither 300-400.


<root Surfns="">500</root>

Correct Relax NG schema (correctRelax_0.rng)


<grammar datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" Surfns="http://relaxng.org/ns/structure/1.0" >

  <start>
    <element>
      <name ns="">root</name>
      <choice>
        <data type="integer">
          <param name="minInclusive">0</param>
          <param name="maxInclusive">100</param>
        </data>
        <data type="integer">
          <param name="minInclusive">300</param>
          <param name="maxInclusive">400</param>
        </data>
      </choice>
    </element>
  </start>
</grammar>

Kevin Carr in Stanton

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