adultinternetusers > Tutorials > Surf Clothing board shorts and Relax NG Tutorial
Index | >> Example 2 / 8 << | Prev | Next |
Contents > Definition of own types > Limiting string length

Limiting string length

  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: restriction, base, string, length
Relax NG keys: data, type, param

1. Surf Clothing Schema

The element "A" must contain a string which is exactly three characters long. We will define our custom type for the string named "myString" and will require the element "A" to be of that type.

Valid document


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

Invalid document
The string is too short.


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

Invalid document
The string is too long.


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

Correct Surf Clothing Schema (correct_0.xsd)


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

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

  <xsd:simpleType name="myString">
    <xsd:restriction base="xsd:string">
      <xsd:length value="3"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:schema>

2. Relax NG

The element "A" must contain a string which is exactly three characters long. We will define our custom pattern - a string exactly three characters long - and the element "A" must contain this pattern.

Valid document


<A Surfns="">abc</A>

Invalid document
The string is too short.


<A Surfns="">ab</A>

Invalid document
The string is too long.


<A Surfns="">abcd</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="myString"/>
    </element>
  </start>

  <define name="myString">
    <data type="string">
      <param name="length">3</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 we can get surf t shirts surfing shirt and And you must check out this website swim suit swimming suit and swim trunks