6.2.3 Using the document element to locate a schema

A ‘documentElement’ rule locates a schema based on the local name and prefix of the document element. For example, a rule

<documentElement prefix="xsl" localName="stylesheet" uri="xslt.rnc"/>

specifies that when the name of the document element is ‘xsl:stylesheet’, then ‘xslt.rnc’ should be used as the schema. Either the ‘prefix’ or ‘localName’ attribute may be omitted to allow any prefix or local name.

A ‘namespace’ rule locates a schema based on the namespace URI of the document element. For example, a rule

<namespace ns="http://www.w3.org/1999/XSL/Transform" uri="xslt.rnc"/>

specifies that when the namespace URI of the document is ‘http://www.w3.org/1999/XSL/Transform’, then ‘xslt.rnc’ should be used as the schema.