<?xml version='1.0'?>
<!--* 
<!DOCTYPE xsl:stylesheet SYSTEM "../../lib/xml/xsl.dtd" [
<!DOCTYPE xsl:stylesheet PUBLIC 'http://www.w3.org/1999/XSL/Transform'
      '../People/cmsmcq/lib/xslt10.dtd' [

<!ATTLIST xsl:stylesheet 
          xml:lang CDATA "en" 
          xmlns CDATA "http://www.w3.org/1999/xhtml" 
          xmlns:xlink CDATA "http://www.w3.org/1999/xlink" 
          xmlns:rddl CDATA "http://www.rddl.org/" 
          xmlns:xsl CDATA "http://www.w3.org/1999/XSL/Transform" 
          xmlns:xs CDATA "http://www.w3.org/2001/XMLSchema"
>
]>
*-->

<xsl:stylesheet version="1.0" 
 exclude-result-prefixes="xs" 
 xmlns="http://www.w3.org/1999/xhtml" 
 xmlns:xlink="http://www.w3.org/1999/xlink" 
 xmlns:rddl="http://www.rddl.org/" 
 xml:lang="en" 
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
 xmlns:xs="http://www.w3.org/2001/XMLSchema">
 <!-- Create a namespace document for the XML Schema namespace.
      Apply to XMLSchema.xsd, needs primitives.nxsd and derived.nxsd
              from XML Schema 1.1 as well. -->
 <!-- See CVS log of http://www.w3.org/XML/Group/2005/12/XMLSchema.html
        and
       http://www.w3.org/Bugs/Public/show_bug.cgi?id=1974
      for history -->
 <!-- Response to WG amendment requests:
      2) add the totally ordered duration types
          Done (marked 'Subject to ratification') 
      3) mark anyAtomicType as subject to ratification
          Done
      4) string.preserve should [be] string.whiteSpace
          Can't fix here - needs datatypes.xml and then
                                 primitives.nxsd to be fixed
      5) make the facets in use for 1.1 items point to the spec
          (rather than the XML source declarations) 
          Done
      6) correct the links that currently don't resolve
          Done -->
 <xsl:output method="xml" 
  doctype-public="-//XML-DEV//DTD XHTML RDDL 1.0//EN" 
  doctype-system="http://www.w3.org/2001/rddl/rddl-xhtml.dtd"/>
 <xsl:variable name="prims" select="document('primitives.nxsd',/*)"/>
 <xsl:variable name="builtins" select="document('derived.nxsd',/*)"/>
 <xsl:variable name="cfacets" select="
  document('XMLSchema.xsd',/)
  //xs:element
  [@id 
   and (@type='xs:facet' 
        or @type='xs:numFacet' 
        or @type='xs:intFacet' 
        or @type='xs:noFixedFacet' 
        or (not(@type) 
            and 
            (xs:complexType/xs:complexContent/xs:restriction/@base='xs:facet' 
             or xs:complexType/xs:complexContent/xs:restriction/@base='xs:numFacet' 
             or xs:complexType/xs:complexContent/xs:restriction/@base='xs:noFixedFacet')))]"/>

 <xsl:template match="/">
  <html xml:lang="en">
   <head profile="http://www.w3.org/2003/g/data-view">
    <title>XML Schema</title>
    <link rel="transformation" href="xsdns-grddl.xsl"/>
   </head>
   <body>
    <h1>XML Schema</h1>
    <div class="head">
     <p>27 January 2011</p>
    </div>
    <div id="toc">
     <h2>Table of contents</h2>
     <ol>
      <li><a href="#intro">Introduction</a></li>
      <li><a href="#related.resources">Resources</a></li>
      <li><a href="#anchors">Anchors for datatypes, facets and facet values</a></li>
      <li><a href="#others">Anchors for other names in the XML Schema namespace</a></li>
     </ol>
    </div>
    <div id="intro">
     <h2>Introduction</h2>
     <p>This document describes the <a href="#xmlschemap1">XML Schema</a> namespace.
      It also contains a directory of links to these related resources, using 
      <a href="http://www.rddl.org/">Resource Directory Description Language</a>.</p>
     <p>It is <a href="http://www.w3.org/TR/GRDDL/">GRDDL</a>-enabled, that is to
      say that a GRDDL-compliant processor can extract useful RDF representations of
      the information contained herein.</p>
    </div>
    <div id="related.resources">
     <h2>Related Resources for XML Schema</h2>
     <!-- start resource definitions -->
     <h2>Schemas for XML Schema</h2>
     <div class="resource" id="DTD">
      <rddl:resource xlink:title="DTD for validation" 
       xlink:arcrole="http://www.rddl.org/purposes#validation" 
       xlink:role="http://www.isi.edu/in-notes/iana/assignments/media-types/application/xml-dtd" 
       xlink:href="XMLSchema.dtd">
       <h3>DTD</h3>
       <p>A ( non-normative) DTD <a href="XMLSchema.dtd">XMLSchema.dtd</a> for XML Schema.  It
	incorporates an auxiliary DTD, <a href="datatypes.dtd">datatypes.dtd</a>.</p>
      </rddl:resource>
     </div>
     <div class="resource" id="xmlschema"> 
      <rddl:resource 
       xlink:title="XML Schema schema document" 
       xlink:role="http://www.w3.org/2001/XMLSchema" 
       xlink:arcrole="http://www.rddl.org/purposes#schema-validation" 
       xlink:href="XMLSchema.xsd">
       <h3>XML Schema</h3>
       <p>An <a href="XMLSchema.xsd">XML Schema schema document</a> for XML Schema
	schema documents.  Last updated with release of working drafts of XML Schema
	1.1 in February and September 2006 (references valid only for XML Schema 1.1
	are noted below as "subject to ratification").</p>	
      </rddl:resource>
     </div>
    </div>
    
    <div id="references">
     <h2>Normative References</h2>
     <ol>
      <li class="resource" id="xmlschemap1">
       <rddl:resource 
	xlink:title="W3C XML Schema Part 1" 
	xlink:role="http://www.w3.org/TR/html4" 
	xlink:arcrole="http://www.rddl.org/purposes#normative-reference" 
	xlink:href="http://www.w3.org/TR/xmlschema-1/">
        <a href="http://www.w3.org/TR/xmlschema-1/">XML Schema Part 1:
	 Structures</a> (2nd Edition)</rddl:resource></li>
      <li class="resource" id="xmlschemap2">
       <rddl:resource 
	xlink:title="W3C XML Schema Part 2" 
	xlink:role="http://www.w3.org/TR/html4" 
	xlink:arcrole="http://www.rddl.org/purposes#normative-reference" 
	xlink:href="http://www.w3.org/TR/xmlschema-2/">
        <a href="http://www.w3.org/TR/xmlschema-2/">XML Schema Part 2:
	 Datatypes</a> (2nd Edition)</rddl:resource></li>
      <li class="resource" id="xmlschemap0">
       <rddl:resource 
	xlink:title="W3C XML Schema Part 0" 
	xlink:role="http://www.w3.org/TR/html4" 
	xlink:arcrole="http://www.rddl.org/purposes#non-normative-reference" 
	xlink:href="http://www.w3.org/TR/xmlschema-0/">
        <a href="http://www.w3.org/TR/xmlschema-0/">XML Schema Part 0:
	 Primer</a> (2nd Edition)</rddl:resource></li>
     </ol>
    </div>
    <div id="anchors">
     <h2>Anchors for datatype-related names with definitions in the XML Schema
      namespace</h2>
     <p><a href="http://www.w3.org/TR/xmlschema-2/">XML Schema Part 2:
       Datatypes</a> advertises anchors within this document for all the
      datatypes, all the kinds of constraining facets and all the uses of 
      facets found therein.  This section contains all those anchors, with 
      forwarding pointers to the relevant anchor in
      the spec.</p>
     <div>
      <h3>The special datatypes</h3>
      <div class="anchor" id="anyAtomicType">
       <rddl:resource 
	xlink:arcrole="http://www.rddl.org/purposes#non-normative-reference" 
	xlink:role="http://www.w3.org/TR/xmlschema11-2/#dt-built-in" 
	xlink:href="http://www.w3.org/TR/xmlschema11-2/#anyAtomicType">The 
	<a href="http://www.w3.org/TR/xmlschema11-2/#anyAtomicType">anyAtomicType</a> 
	built-in special datatype (subject to ratification).</rddl:resource>
      </div>
      <div class="anchor" id="anySimpleType">
       <rddl:resource 
	xlink:arcrole="http://www.rddl.org/purposes#normative-reference" 
	xlink:role="http://www.w3.org/TR/xmlschema-2/#dt-built-in" 
	xlink:href="http://www.w3.org/TR/xmlschema-2/#dt-anySimpleType">The 
	<a href="http://www.w3.org/TR/xmlschema-2/#dt-anySimpleType">anySimpleType</a> 
	built-in special datatype.</rddl:resource></div>
     </div>
     <div>
      <h3>The built-in primitive datatypes</h3>
      <xsl:call-template name="doAnchors">
       <xsl:with-param name="refs" select="$prims//xs:simpleType[@id]"/>
       <xsl:with-param name="prose">The</xsl:with-param>
       <xsl:with-param name="after-prose">built-in primitive datatype</xsl:with-param>
       <xsl:with-param name="nature">dt-built-in</xsl:with-param>
       <xsl:with-param name="v11only">precisionDecimal</xsl:with-param>
      </xsl:call-template>
     </div>
     <div>
      <h3>The built-in ordinary datatypes</h3>
      <xsl:call-template name="doAnchors">
       <xsl:with-param name="refs" select="$builtins//xs:simpleType[@id]"/>
       <xsl:with-param name="prose">The</xsl:with-param>
       <xsl:with-param name="after-prose">built-in ordinary datatype</xsl:with-param>
       <xsl:with-param name="nature">dt-built-in</xsl:with-param>
       <xsl:with-param name="v11only">dayTimeDuration yearMonthDuration</xsl:with-param>
      </xsl:call-template>
     </div>
     
     <div id="cfacets">
      <h3>Kinds of Constraining Facets</h3>
      <xsl:call-template name="doAnchors">
       <xsl:with-param name="refs" select="$cfacets"/>
       <xsl:with-param name="prose">The</xsl:with-param>
       <xsl:with-param name="after-prose">constraining facet</xsl:with-param>
       <xsl:with-param name="nature">rf-facets</xsl:with-param>
       <xsl:with-param name="prefix">rf-</xsl:with-param>
       <xsl:with-param name="v11only">minScale maxScale</xsl:with-param>
       <xsl:with-param name="elt-also">1</xsl:with-param>
      </xsl:call-template>
     </div>
     
     <div>
      <h3>Facets in use</h3>
      <p>Instances of constraining facets are used in the definitions of many 
       of the built-in datatypes.</p>
      <xsl:call-template name="doAnchors">
       <xsl:with-param name="refs" 
	select="$builtins//*[@id and not(self::xs:element|self::xs:simpleType)]"/>
       <xsl:with-param name="prose">The instance of the</xsl:with-param>
       <xsl:with-param name="mid-prose">facet used in the definition of the</xsl:with-param>
       <xsl:with-param name="after-prose">datatype</xsl:with-param>
       <xsl:with-param name="nature">f</xsl:with-param>
       <!-- Change this to part 2 of the REC in due course -->
       <xsl:with-param name="schema">XMLSchema.xsd</xsl:with-param>
       <xsl:with-param name="v11only">dayTimeDuration.pattern
	yearMonthDuration.pattern</xsl:with-param>
      </xsl:call-template>
      <xsl:call-template name="doAnchors">
       <xsl:with-param name="refs" 
	select="$prims//*[@id and not(self::xs:element|self::xs:simpleType)]"/>
       <xsl:with-param name="prose">The instance of the</xsl:with-param>
       <xsl:with-param name="mid-prose">facet used in the definition of the</xsl:with-param>
       <xsl:with-param name="after-prose">datatype</xsl:with-param>
       <xsl:with-param name="nature">f</xsl:with-param>
       <!-- Change this to derived.nxsd in due course -->
       <xsl:with-param name="schema">XMLSchema.xsd</xsl:with-param>
       <xsl:with-param name="v11only">precisionDecimal.whiteSpace</xsl:with-param>
      </xsl:call-template>
     </div>
    </div>
    <div id="others">
     <h2>Anchors for other names in the XML Schema namespace</h2>
     <div>
      <h3>Anchors for element declarations</h3>
      <p>This list includes all elements whose declarations are covered in the REC
       (except those which are used to represent constraining facets, which 
       already appear <a href="#cfacets">above</a>).</p>
      <xsl:for-each select="xs:schema//xs:element[.//xs:annotation/xs:documentation/@source]">
       <xsl:sort select="@id"/>
       <xsl:if test="not($cfacets[@name=current()/@name])">
	<xsl:call-template name="doAnchors">
	 <xsl:with-param name="refs" select="."/>
	 <xsl:with-param name="prose">The</xsl:with-param>
	 <xsl:with-param name="after-prose">element</xsl:with-param>
	 <xsl:with-param name="nature">element</xsl:with-param>
	 <xsl:with-param name="prefix">element-</xsl:with-param>
         <xsl:with-param name="v11only">assertion defaultOpenContent
openContent override</xsl:with-param>
	</xsl:call-template>
       </xsl:if>
      </xsl:for-each>
     </div>
    </div>
   </body>
  </html>
 </xsl:template>
 
 <xsl:template name="doAnchors">
  <xsl:param name="refs"/>
  <xsl:param name="nature"/>
  <xsl:param name="prose"/>
  <xsl:param name="after-prose"/>
  <xsl:param name="mid-prose"/>
  <xsl:param name="prefix"/>
  <xsl:param name="v11only"/>
  <xsl:param name="schema"/>
  <xsl:param name="elt-also">0</xsl:param>
  <xsl:for-each select="$refs">
   <xsl:sort select="@id"/>
   <xsl:variable name="VV">
    <xsl:choose>
     <xsl:when test="contains($v11only,@id)">11</xsl:when>
     <xsl:otherwise/>
    </xsl:choose>
   </xsl:variable>
   <!-- <xsl:message><xsl:value-of select="@id"/> <xsl:value-of select="$VV"/> 
        <xsl:value-of select="$v11only"/></xsl:message>
   -->
   <xsl:variable name="link" select="concat('http://www.w3.org/TR/xmlschema',
                                            $VV,
                                            '-2/')"/>
   <div class="anchor" id="{@id}">
    
    <xsl:variable name="xschema">
     <xsl:choose>
      <xsl:when test="$mid-prose='' or $VV!='11'">
       <xsl:value-of select="$schema"/>    
      </xsl:when>
      <xsl:otherwise></xsl:otherwise>
     </xsl:choose>
    </xsl:variable>
    <xsl:variable name="xlink">  
     <xsl:choose>
      <xsl:when test="contains(xs:annotation/xs:documentation/@source,'xmlschema-1') 
       or contains(xs:annotation/xs:documentation/@source,'structures')">
       <xsl:value-of select="translate($link,'2','1')"/>
      </xsl:when>
      <xsl:otherwise>
       <xsl:value-of select="$link"/>
      </xsl:otherwise>
     </xsl:choose>
    </xsl:variable>
    <!--<xsl:message><xsl:value-of select="@id"/>|<xsl:value-of select="$mid-prose=''"/>
    |<xsl:value-of select="$VV"/>|<xsl:value-of select="$xschema"/></xsl:message>-->
    <rddl:resource 
     xlink:arcrole="http://www.rddl.org/purposes#normative-reference" 
     xlink:role="{$xlink}#{$nature}" 
     xlink:href="{$xlink}{$xschema}#{$prefix}{@id}">
     <xsl:value-of select="$prose"/>
     <xsl:text> </xsl:text>
     <xsl:choose>
      <xsl:when test="$mid-prose=''">
     <a href="{$xlink}{$xschema}#{$prefix}{@id}"><xsl:value-of select="@id"/></a>
    </xsl:when>
     <xsl:otherwise>
     <a href="{$xlink}{$xschema}#{$prefix}{@id}"><xsl:value-of select="substring-after(@id,'.')"/></a>
     <xsl:text> </xsl:text>
     <xsl:value-of select="$mid-prose"/>
     <xsl:text> </xsl:text>
     <strong><xsl:value-of select="substring-before(@id,'.')"/></strong>
    </xsl:otherwise>
    </xsl:choose>
     <xsl:if test="not($after-prose='')">
      <xsl:text> </xsl:text>
      <xsl:value-of select="$after-prose"/>
     </xsl:if>
     <xsl:if test="$VV='11'">
      <xsl:text> (subject to ratification)</xsl:text>
     </xsl:if>
     <xsl:text>.</xsl:text></rddl:resource> 
    <xsl:if test="$elt-also='1'">
    <rddl:resource 
     xlink:arcrole="http://www.rddl.org/purposes#normative-reference" 
     xlink:role="{$xlink}#element" 
     xlink:href="{$xlink}#element-{@id}">
     <xsl:text>See also the </xsl:text>
     <a href="{$xlink}#element-{@id}"><xsl:value-of select="@id"/></a>
     <xsl:text> element for declaring a value for the above facet.</xsl:text>
    </rddl:resource>
   </xsl:if>
   </div>
   <xsl:text>
   </xsl:text>
  </xsl:for-each>
 </xsl:template>
</xsl:stylesheet>
<!-- Keep this comment at the end of the file
Local variables:
mode: xml
sgml-default-dtd-file:"/Library/SGML/Public/Emacs/xslt.ced"
sgml-omittag:t
sgml-shorttag:t
sgml-indent-data:t
sgml-indent-step:1
End:
-->

