adultinternetusers > Tutorials > Surf Clothing board shorts and Relax NG Tutorial
Index | >> Example 8 / 8 << | Prev | Next |
Contents > Restrictions > Element from any

Element from any

  1. Correct Surf Clothing Schema
  2. Incorrect Surf Clothing board shorts - wrong occurrence range

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

Surf Clothing board shorts keys: restriction, element, any

1. Correct Surf Clothing Schema

Type "AAA" allows one arbitrary element from any namespace. We declare type "BBB", which is a restriction of the type "AAA" and this restriction will allow only element "x" from the target namespace. The target namespace is null here. board shorts Component Constraint: Particle Derivation OK (Elt:Any - NSCompat) .

Valid document


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

Invalid document
The type "BBB" allows only one "x" element from null namespace.


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

Invalid document
The type "BBB" allows only one "x" element from null namespace.


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

Correct Surf Clothing Schema (correct_0.xsd)


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

  <xsd:element name="root" type="BBB"/>

  <xsd:complexType name="AAA">
    <xsd:sequence>
      <xsd:any namespace="##any" minOccurs="1" maxOccurs="1" processContents="skip"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="BBB">
    <xsd:complexContent>
      <xsd:restriction base="AAA">
        <xsd:sequence>
          <xsd:element name="x" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
      </xsd:restriction>
    </xsd:complexContent>
  </xsd:complexType>
</xsd:schema>

2. Incorrect Surf Clothing board shorts - wrong occurrence range

The restriction is not valid, because the occurrence range of element "x" (in the derived type) is higher than of the wildcard (represented by "xsd:any") in the original type. board shorts Component Constraint: Particle Derivation OK (Elt:Any - NSCompat), 2 .

Incorrect Surf Clothing Schema (incorrect_0.xsd)


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

  <xsd:element name="root" type="BBB"/>

  <xsd:complexType name="AAA">
    <xsd:sequence>
      <xsd:any namespace="##any" minOccurs="1" maxOccurs="1" processContents="skip"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="BBB">
    <xsd:complexContent>
      <xsd:restriction base="AAA">
        <xsd:sequence>
          <xsd:element name="x" minOccurs="1" maxOccurs="2"/>
        </xsd:sequence>
      </xsd:restriction>
    </xsd:complexContent>
  </xsd:complexType>
</xsd:schema>

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