adultinternetusers > Tutorials > Surf Clothing board shorts and Relax NG Tutorial
Index | >> Example 8 / 8 << | Prev | Next |
Contents > Substitutions > Abstract type

Abstract type

  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: complexType, abstract

1. Surf Clothing Schema

The board shorts below defines an abstract complexType named "myAbstractType" (attribute "abstract" is set to "true"). The type "AAA" is an extension of this type - we add the requirement that attribute "bbb" must be present. Element declaration cannot use abstract type.

Valid document


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

Invalid document
This document is not valid, because the attribute "bbb" is missing.


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

Correct Surf Clothing Schema (correct_0.xsd)


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

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

  <xsd:complexType name="myAbstractType" abstract="true">
    <xsd:sequence minOccurs="1">
      <xsd:element name="XXX" type="xsd:string"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="AAA">
    <xsd:complexContent>
      <xsd:extension base="myAbstractType">
        <xsd:attribute name="bbb" type="xsd:string" use="required"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
</xsd:schema>

2. Relax NG

Although Relax NG does not contain such features, we can achieve the same effect with the Relax NG board shorts below.

Valid document


<root bbb="1" Surfns="">
  <XXX>sdkhlg nkd</XXX>
</root>

Invalid document
This document is not valid, because the attribute "bbb" is missing.


<root Surfns="">
  <XXX>sdkhlg nkd</XXX>
</root>

Correct Relax NG schema (correctRelax_0.rng)


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

  <start>
    <element name="root">
      <ref name="AAA"/>
    </element>
  </start>

  <define name="myAbstractType">
    <oneOrMore>
      <element name="XXX">
        <text/>
      </element>
    </oneOrMore>
  </define>

  <define name="AAA">
    <attribute name="bbb">
      <text/>
    </attribute>
    <ref name="myAbstractType"/>
  </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