This section is just a primer. The reference documentation about this topic is really Section 25, “relaxng” in XMLmind XML Editor - Configuration and Deployment.
A document type declaration (<!DOCTYPE>
) can be used to associate a DTD to a document. Attributes xsi:schemaLocation
/xsi:noNamespaceSchemaLocation
can be used to associate W3C XML Schemas to a document. But there is no standard way to associate a RELAX NG schema to a document. Therefore this association must be made using an external specification such as the Namespace Routing Language (NRL).
In the case of XMLmind XML Editor, this external specification is simply a configuration element called relaxng
.
XHTML example:
<configuration name="XHTML Strict [RELAX NG]" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.xmlmind.com/xmleditor/schema/configuration"> <include location="xxe-config:schema/ns_xhtml.incl" /> <detect> <rootElementNamespace>http://www.w3.org/1999/xhtml</rootElementNamespace> </detect> <relaxng location="xxe-config:common/rng/xhtml1/xhtml-strict.rng" /> <preserveSpace elements="html:pre html:style html:script" /> <css name="XHTML" location="xhtml_rng.css" /> <template name="Page" location="page.html" /> </configuration>
The | |
Unlike the DTD, |
The <?xml-model>
processing instruction allows to associate schema documents written in any schema definition language with a given XML document. As such, it may be used to associate a RELAX NG schema, written using either the XML or the compact syntax, with a document. Example (excerpts from name.xml):
<?xml version="1.0"?> <?xml-model href="name.rnc" type="application/relax-ng-compact-syntax"?> <names> <name><fullName>John Smith</fullName></name> ...