14. Documenting Schemas (samples)

Sample 1

[download]


  <xs:element name="author" type="author">
    <xs:annotation>
      <xs:documentation xml:lang="en">
        The author of a book.
      </xs:documentation>
      <xs:documentation xml:lang="fr">
        Designe l'auteur d'un livre.
      </xs:documentation>
    </xs:annotation>
  </xs:element>

Sample 2

[download]


  <xs:element name="author" type="author">
    <xs:annotation>
      <xs:documentation xml:lang="en">
        <p id="author" xmlns="http://www.w3.org/1999/xhtml">
          This element describes the
          <em>
            author
          </em>
          of a
          <a href="#book">
            book
          </a>
        </p>
        .
      </xs:documentation>
    </xs:annotation>
  </xs:element>

Sample 3




  <svg xmlns="http://www.w3.org/2000/svg">
    <title>
      An author
    </title> 
    <ellipse style="stroke:#000000; fill:#e3e000;    
      stroke-width:2pt;"id="head" cx="280" cy="250" rx="110" ry="130"/> 
    <ellipse style="stroke:none; fill:#7f7f7f;  " id="leftEye"
      cx="240"cy="225" rx="18" ry="18"/> 
    <ellipse style="stroke:none; fill:#7f7f7f;  " id="rightEye"
      cx="320"cy="225" rx="18" ry="18"/> 
    <path style="fill:none;stroke:#7F7F7F; stroke-width:5pt;"
      id="mouth"d="M 222 280 A 58 48 0 0 0 338 280"/>
  </svg>



Sample 4

[download]


  <xs:element name="author" type="author">
    <xs:annotation>
      <xs:documentation>
        <svg xmlns="http://www.w3.org/2000/svg">
          <title>
            An author
          </title> 
          <ellipse style="stroke:#000000; fill:#e3e000;
            stroke-width:2pt;" id="head" cx="280" cy="250" rx="110"
            ry="130"/> 
          <ellipse style="stroke:none; fill:#7f7f7f; " id="leftEye"
            cx="240"cy="225" rx="18" ry="18"/> 
          <ellipse style="stroke:none; fill:#7f7f7f; " id="rightEye"
            cx="320"cy="225" rx="18" ry="18"/> 
          <path style="fill:none;stroke:#7F7F7F; stroke-width:5pt;"
            id="mouth"d="M 222 280 A 58 48 0 0 0 338 280"/>
        </svg>
      </xs:documentation>
    </xs:annotation>
  </xs:element>

Sample 5

[download]


  <xs:element name="author" type="author">
    <xs:annotation>
      <xs:appinfo xmlns:dc="http://purl.org/dc/elements/1.1/">
        <dc:creator>
          Eric van der Vlist (mailto:vdv@dyomedea.com)
        </dc:creator>
        <dc:date>
          2002-02-01
        </dc:date>
        <dc:subject>
          author,person,book
        </dc:subject>
        <dc:description>
          This element describes the author of a book.
        </dc:description>
      </xs:appinfo>
    </xs:annotation>
  </xs:element>

Sample 6

[download]


  <xs:simpleType name="string" id="string">
    <xs:annotation>
      <xs:appinfo>
        <hfp:hasFacet name="length"/>
        <hfp:hasFacet name="minLength"/>
        <hfp:hasFacet name="maxLength"/>
        <hfp:hasFacet name="pattern"/>
        <hfp:hasFacet name="enumeration"/>
        <hfp:hasFacet name="whiteSpace"/>
        <hfp:hasProperty name="ordered" value="false"/>
        <hfp:hasProperty name="bounded" value="false"/> 
        <hfp:hasProperty name="cardinality" value="countably
          infinite"/>
        <hfp:hasProperty name="numeric" value="false"/>
      </xs:appinfo> 
      <xs:documentation
        source="http://www.w3.org/TR/xmlschema-2/#string"/>
    </xs:annotation>
    <xs:restriction base="xs:anySimpleType">
      <xs:whiteSpace value="preserve" id="string.preserve"/>
    </xs:restriction>
  </xs:simpleType>

Sample 7

[download]


  <xs:element name="author" type="author">
    <xs:annotation> 
      <xs:appinfo source="saf:meta-data-item"
        xmlns:sql="http://www.extensibility.com/saf/spec/safsample/sql-map.saf"
        >
        <sql:select>
          select
          <sql:elem>
            name
          </sql:elem>
          ,
          <sql:elem>
            birthdate
          </sql:elem>
          ,
          <sql:attr>
            deathdate
          </sql:attr>
          from tbl_author
        </sql:select>
      </xs:appinfo>
    </xs:annotation>
  </xs:element>

Sample 8

[download]


  <xs:element name="author" type="author">
    <xs:annotation>
      <xs:appinfo xmlns:sch="http://www.ascc.net/xml/schematron">
        <sch:pattern name="Born before dead">
          <sch:rule context="author"> 
            <sch:assert test="not(dead) or (dead > born)"
              diagnostics="bornAfterDead">
              An author should die after her or his death.
            </sch:assert>
            <sch:diagnostics>
              <sch:diagnostic id="bornAfterDead"> 
                Error, this author is born after her or his birth!
                Author=
                <sch:value-of select="name"/>
                Birth =
                <sch:value-of select="born"/>
                Death =
                <sch:value-of select="dead"/>
              </sch:diagnostic>
            </sch:diagnostics>
          </sch:rule>
        </sch:pattern>
      </xs:appinfo>
    </xs:annotation>
  </xs:element>

Sample 9

[download]


  <xs:element name="book" type="book">
    <xs:annotation>
      <xs:appinfo xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template match="book">
          <xsl:apply-templates select="title"/>
          <xsl:apply-templates select="isbn"/>
          <p>
            Authors:
          </p>
          <ul>
            <xsl:apply-templates select="author"/>
          </ul>
          <p>
            Characters:
          </p>
          <ul>
            <xsl:apply-templates select="character"/>
          </ul>
        </xsl:template>
      </xs:appinfo>
    </xs:annotation>
  </xs:element>

Sample 10

[download]


  <xs:element name="author" type="author">
    <xs:annotation> 
      <xs:appinfo xmlns:xlink="http://www.w3.org/1999/xlink"
        xmlns:rddl="http://www.rddl.org/"> 
        <rddl:resource id="author-transform"
          xlink:arcrole="http://www.w3.org/1999/xhtml"
          xlink:role="http://www.w3.org/1999/XSL/Transform"
          xlink:title="Author template"
          xlink:href="library.xslt#author">
          <div class="resource">
            <h4>
              XSLT Transformation
            </h4>
            <p>
              This
              <a href="library.xslt#author">
                template
              </a>
              displays the description of an author.
            </p>
          </div>
        </rddl:resource> 
        <rddl:resource id="CSS" xlink:title="CSS Stylesheet"
          xlink:role="http://www.isi.edu/in-notes/iana/assignments/media-types/text/css"
          xlink:href="author.css">
          <div class="resource">
            <h4>
              CSS Stylesheet
            </h4>
            <p>
              A
              <a href="author.css">
                CSS stylesheet
              </a> 
              defining the styles which may be used to display an
              author.
            </p>
          </div>
        </rddl:resource>
      </xs:appinfo>
    </xs:annotation>
  </xs:element>

Sample 11

[download]

 
  <xs:element name="author" type="author" doc:doc="This element
    describes the author of a book."
    xmlns:doc="http://dyomedea.com/ns/doc"/>

Sample 12

[download]

 
  <xs:element name="author" type="author" sql:table="TBL_AUTHOR"
    xmlns:sql="http://www.extensibility.com/saf/spec/safsample/sql-map.saf"
    />

Sample 13

[download]

 
  <xs:element name="author" type="author"
    xlink:arcrole="http://www.w3.org/1999/xhtml"
    xlink:role="http://www.w3.org/1999/XSL/Transform"
    xlink:title="Author template" xlink:href="library.xslt#author"
    xmlns:xlink="http://www.w3.org/1999/xlink"/>

Sample 14

[download]


  <xs:element name="author" type="author">
    <xs:annotation> 
      <xs:appinfo
        xlink:arcrole="http://www.w3.org/1999/XSL/Transform"
        xlink:role="http://www.w3.org/1999/XSL/Transform"
        xlink:title="Author template" xlink:href="library.xslt#author"
        xmlns:xlink="http://www.w3.org/1999/xlink">
        <div class="resource">
          <h4>
            XSLT Transformation
          </h4>
          <p>
            This
            <a href="library.xslt#author">
              template
            </a>
            displays the description of an author.
          </p>
        </div>
      </xs:appinfo> 
      <xs:appinfo title="CSS Stylesheet"
        role="http://www.isi.edu/in-notes/iana/assignments/media-types/text/css"
        href="author.css">
        <div class="resource">
          <h4>
            CSS Stylesheet
          </h4>
          <p>
            A
            <a href="author.css">
              CSS stylesheet
            </a> 
            defining the styles which may be used to display an
            author.
          </p>
        </div>
      </xs:appinfo>
    </xs:annotation>
  </xs:element>

Sample 15

[download]


  <xs:element name="author" type="author">
    <!-- This element describes the author of a book. -->
  </xs:element>

Sample 16

[download]


  <xs:element name="author" type="author">
    <xs:annotation>
      <xs:documentation xml:lang="en">
        The author of a book.
      </xs:documentation>
      <xs:documentation xml:lang="fr">
        Designe l'auteur d'un livre.
      </xs:documentation>
    </xs:annotation>
  </xs:element>

Sample 17

[download]

 
  <xs:element name="author" type="author" doc:doc="This element
    describes the author of a book."
    xmlns:doc="http://dyomedea.com/ns/doc"/>

Sample 18

[download]


  <xs:element name="author" type="author">
    <!-- This element describes the author of a book. -->
  </xs:element>