Next / Previous / Contents / Shipman's homepage

4.3. The default schemas.xml file

Here is schema/schemas.xml, the default schema locating in the nxml installation directory.

<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
  <transformURI fromPattern="*.xml"             1
                toPattern="*.rnc"/>

  <uri pattern=".xsl" typeId="XSLT"/>           2
  <uri pattern=".html" typeId="XHTML"/>
  <uri pattern=".rng" typeId="RELAX NG"/>
  <uri pattern=".rdf" typeId="RDF"/>
  
  <namespace ns="http://www.w3.org/1999/XSL/Transform"
             typeId="XSLT"/>                    3
  <namespace ns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             typeId="RDF"/>
  <namespace ns="http://www.w3.org/1999/xhtml"
             typeId="XHTML"/>
  <namespace ns="http://relaxng.org/ns/structure/1.0"
             typeId="RELAX NG"/>
  <namespace ns="http://thaiopensource.com/ns/locating-rules/1.0"
	         uri="locate.rnc"/>

  <documentElement localName="stylesheet"       4
                   typeId="XSLT"/>
  <documentElement prefix="xsl" localName="transform" typeId="XSLT"/>

  <documentElement localName="html" typeId="XHTML"/>

  <documentElement localName="grammar" typeId="RELAX NG"/>

  <documentElement prefix="" localName="article" typeId="DocBook"/>
  <documentElement prefix="" localName="book" typeId="DocBook"/>

  <documentElement localName="RDF" typeId="RDF"/>
  <documentElement prefix="rdf" typeId="RDF"/>
  
  <documentElement localName="locatingRules" uri="locate.rnc"/>

  <typeId id="XSLT" uri="xslt.rnc"/>            5
  <typeId id="RELAX NG" uri="relaxng.rnc"/>
  <typeId id="XHTML" uri="xhtml.rnc"/>
  <typeId id="DocBook" uri="docbook.rnc"/>
  <typeId id="RDF" uri="rdfxml.rnc"/>
</locatingRules>
1 If a file's name is f.xml, and there is a Relax NG compact schema file f.rnc, use that schema. For example, if your file is named kites.xml and its Relax NG compact schema lives in file kites.rnc, that schema will be used.
2 This line and the three that follow set up rules for the standard file extensions for XSLT, XHTML, Relax NG, and RDF (Resource Definition Framework) files. Each rule refers to a type ID defined further down. For example, any file whose name ends in .xsl is referred to type ID "XSLT", which is later connected to the XSLT schema in xslt.rnc.
3 These five elements set up rules for files by namespace URIs: XSLT, RDF, XHTML, Relax NG (in the XML format), and RNC (Relax NG in the compact format).
4 These elements set up default schemas for XSLT, XHTML, Relax NG, DocBook, RDF, and RNC document types, based on the name of the root element. For example, any file whose root element is article is assumed to be a DocBook article.
5 These lines connect the type IDs used above to the actual schema files. Because local URIs are resolved relative to the schema locating file in which they live, these rules will find the RNC schema files that are located in the same directory as the default schemas.xml file.