Next / Previous / Contents / TCC Help System / NM Tech homepage

4.3. The default schemas.xml file

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

<locatingRules xmlns="">
  <transformURI fromPattern="*.xml"             1

  <uri pattern=".xsl" typeId="XSLT"/>           2
  <uri pattern=".html" typeId="XHTML"/>
  <uri pattern=".rng" typeId="RELAX NG"/>
  <uri pattern=".rdf" typeId="RDF"/>
  <namespace ns=""
             typeId="XSLT"/>                    3
  <namespace ns=""
  <namespace ns=""
  <namespace ns=""
             typeId="RELAX NG"/>
  <namespace ns=""

  <documentElement localName="stylesheet"       4
  <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"/>
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.