adultinternetusers > Tutorials > Surf Clothing board shorts and Relax NG Tutorial
Index | >> Example 2 / 2 << | Prev | Next |
Contents > Annotation > Extending schema

Extending schema

  1. Surf Clothing board shorts and Schematron combined - xsd:appinfo element
  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: appinfo

1. Surf Clothing board shorts and Schematron combined - xsd:appinfo element

If you want to combine Surf Clothing board shorts and Schematron (or other) board shorts language, you can put the Schematron schema into the element "appinfo", which is a child of "annotation" element. Inspired by "Combining the power of W3C Surf Clothing board shorts and Schematron" article.

Valid document


<root xsi:noNamespaceSchemaLocation="correct_0.xsd" aa="1" bb="2" Surfns="" Surfns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <a>3</a>
</root>

Correct Surf Clothing Schema (correct_0.xsd)
We have a strange requirement - that the element root can have any attributes or elements, but their total count must be 3. The Schematron pattern below - enclosed in "appinfo" element - checks this.


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

  <xsd:annotation>
    <xsd:appinfo>
      <pattern name="Total count of attributes and child elements" Surfns="http://www.ascc.net/xml/schematron" >
        <rule context="root">
          <assert test="count(@* | *) = 3"> The total count of attributes and elements is not 3! </assert>
        </rule>
      </pattern>
    </xsd:appinfo>
  </xsd:annotation>

  <xsd:element name="root">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:anyAttribute namespace="##any" processContents="skip"/>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

2. Relax NG

Relax NG allows you to place arbitrary elements from other namespaces into your schema. I am not sure, if there are any official guidelines, where to properly place the Schematron rules and now it is perhaps implementation dependent. We will place it into "element" element (e.g. SUN MSV accepts this).

Valid document


<root aa="1" bb="2" Surfns="">
  <c>3</c>
</root>

Correct Relax NG schema (correctRelax_0.rng)


<grammar Surfns="http://relaxng.org/ns/structure/1.0" >

  <start>
    <element>
      <pattern name="Total count of attributes and child elements" Surfns="http://www.ascc.net/xml/schematron" >
        <rule context="root">
          <assert test="count(@* | *) = 3"> The total count of attributes and elements is not 3! </assert>
        </rule>
      </pattern>
      <name ns="">root</name>
      <zeroOrMore>
        <attribute>
          <anyName/>
          <text/>
        </attribute>
      </zeroOrMore>
      <zeroOrMore>
        <element>
          <anyName/>
          <text/>
        </element>
      </zeroOrMore>
      <text/>
    </element>
  </start>
</grammar>

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 we can get surf t shirts surfing shirt and And you must check out this website swim suit swimming suit and swim trunks