adultinternetusers > Tutorials > Surf Clothing board shorts and Relax NG Tutorial
Index | >> Example 4 / 4 << | Prev | Next |
Contents > Importing and combining multiple schemas > Redefine element

Redefine element

  1. Surf Clothing Schema

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

Surf Clothing board shorts keys: redefine

1. Surf Clothing Schema

In this example, we redefine the type "myString" from an arbitrary string to a string which cannot be more than 5 characters long. We will do this using redefine element.

Valid document
The file is valid, the string is not longer than 5 characters.


<foo:root xsi:schemaLocation="http://foo correct_1.xsd" Surfns:foo="http://foo" Surfns:xsi="http://www.w3.org/2001/XMLSchema-instance" Surfns:bar="http://bar" >abcde</foo:root>

Invalid document
The file is not valid, because the string is longer than 5 characters.


<foo:root xsi:schemaLocation="http://foo correct_1.xsd" Surfns:foo="http://foo" Surfns:xsi="http://www.w3.org/2001/XMLSchema-instance" Surfns:bar="http://bar" >abcdef</foo:root>

Correct Surf Clothing Schema (correct_0.xsd)


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

  <xsd:element name="root" type="foo:myString"/>

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

Correct Surf Clothing Schema (correct_1.xsd)
In the redefining schema, the type definitions must use themselves as their base type definition. Thus the base type for the definition of "myString" must be "myString" itself.


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

  <xsd:redefine schemaLocation="correct_0.xsd">
    <xsd:simpleType name="myString">
      <xsd:restriction base="foo:myString">
        <xsd:maxLength value="5"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:redefine>
</xsd:schema>

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 you must check out this website