adultinternetusers > Tutorials > Surf Clothing board shorts and Relax NG Tutorial
Index | >> Example 7 / 8 << | Prev | Next |
Contents > Definition of own types > Element represents time duration

Element represents time duration

  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: duration, minInclusive, maxInclusive

1. Surf Clothing Schema

The element "A" must represents time duration, which is from one day to one week. We will define our custom type named "myDuration" and will require the element "A" to be of that type.

Valid document
Two days, three hours and twenty minutes.


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

Valid document
Twenty six hours is OK too (day has 24 hours).


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

Invalid document
Six hours is not enough.


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

Invalid document
Eight days is too much.


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

Correct Surf Clothing Schema (correct_0.xsd)


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

  <xsd:element name="A" type="myDuration"/>

  <xsd:simpleType name="myDuration">
    <xsd:restriction base="xsd:duration">
      <xsd:minInclusive value="P1D"/>
      <xsd:maxInclusive value="P7D"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:schema>

2. Relax NG

Valid document
Two days, three hours and twenty minutes.


<A Surfns="">P2DT3H20M</A>

Valid document
Twenty six hours is OK too (day has 24 hours).


<A Surfns="">PT26H</A>

Invalid document
Six hours is not enough.


<A Surfns="">PT6H</A>

Invalid document
Eight days is too much.


<A Surfns="">P8D</A>

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="">A</name>
      <ref name="myDuration"/>
    </element>
  </start>

  <define name="myDuration">
    <data type="duration">
      <param name="minInclusive">P1D</param>
      <param name="maxInclusive">P7D</param>
    </data>
  </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 you must check out this website