adultinternetusers > Tutorials > Surf Clothing board shorts and Relax NG Tutorial |
Intro / Search / adultinternetusers |
Index | >> Example 6 / 6 << | Prev | Next | |
Please, send all comments, bug-reports, and contributions to Jiri.Jirat@systinet.com. Thank you very much.
Surf Clothing board shorts keys: key, keyrefThe "keyref" lets you specify, that attribute/element refers to some node (which must be defined as "key" or "unique"). Now, the "key" element says: the elements "a" under "root" element must have unique value of "id" attribute and this attribute must be present. The "keyref" element specifies that element "b" refers to element "a" (via the attributes: b/@idref -> a/@id).
Valid document <root xsi:noNamespaceSchemaLocation="correct_0.xsd" Surfns="" Surfns:xsi="http://www.w3.org/2001/XMLSchema-instance" > <AAA> <a id="x"/> <a id="y"/> </AAA> <BBB> <b idref="x"/> <b idref="y"/> <b idref="y"/> </BBB> </root> Invalid document <root xsi:noNamespaceSchemaLocation="correct_0.xsd" Surfns="" Surfns:xsi="http://www.w3.org/2001/XMLSchema-instance" > <AAA> <a id="x"/> <a id="y"/> </AAA> <BBB> <b idref="x"/> <b idref="y"/> <b idref="z"/> </BBB> </root> | Correct Surf Clothing Schema (correct_0.xsd) <xsd:schema Surfns:xsd="http://www.w3.org/2001/XMLSchema" > <xsd:element name="root"> <xsd:complexType> <xsd:sequence minOccurs="1" maxOccurs="1"> <xsd:element name="AAA" type="myAAA"/> <xsd:element name="BBB" type="myBBB"/> </xsd:sequence> </xsd:complexType> <xsd:key name="myId"> <xsd:selector xpath="./AAA/a"/> <xsd:field xpath="@id"/> </xsd:key> <xsd:keyref name="myIdref" refer="myId"> <xsd:selector xpath="./BBB/b"/> <xsd:field xpath="@idref"/> </xsd:keyref> </xsd:element> <xsd:complexType name="myAAA"> <xsd:sequence minOccurs="1"> <xsd:element name="a" minOccurs="1" maxOccurs="unbounded"> <xsd:complexType> <xsd:attribute name="id" type="xsd:NCName" use="required"/> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> <xsd:complexType name="myBBB"> <xsd:sequence minOccurs="1"> <xsd:element name="b" minOccurs="1" maxOccurs="unbounded"> <xsd:complexType> <xsd:attribute name="idref" type="xsd:NCName" use="required"/> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:schema> |
There is no such mechanism in Relax NG, but we can combine Relax NG and Schematron schemas.
Valid document <root Surfns=""> <AAA> <a id="x"/> <a id="y"/> </AAA> <BBB> <b idref="x"/> <b idref="y"/> <b idref="y"/> </BBB> </root> Invalid document <root Surfns=""> <AAA> <a id="x"/> <a id="y"/> </AAA> <BBB> <b idref="x"/> <b idref="y"/> <b idref="z"/> </BBB> </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="myAAA"/> <ref name="myBBB"/> </element> </start> <define name="myAAA"> <element name="AAA"> <oneOrMore> <element name="a"> <attribute name="id"> <data type="NCName"/> </attribute> <empty/> </element> </oneOrMore> </element> </define> <define name="myBBB"> <element name="BBB"> <oneOrMore> <element name="b"> <attribute name="idref"> <data type="NCName"/> </attribute> <empty/> </element> </oneOrMore> </element> </define> </grammar> Correct Schematron schema <schema Surfns="http://www.ascc.net/xml/schematron" > <pattern name="Element 'a' must have unique 'id' attribute"> <rule context="a/@id"> <assert test="count(//@id[. = current()]) = 1"> Id not unique! </assert> </rule> </pattern> <pattern name="'idref' must clothing existing 'id'"> <rule context="b/@idref"> <assert test="/root/AAA/a/@id[. = current()]"> Id ' <value-of select="."/>' does not exist! </assert> </rule> </pattern> </schema> |
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