This chapter address various (pretty minor) syntax issues. If you want the whole story, see the full Relax NG schema, or nvdl.html which is a prettier version of the same information.
I stated earlier that I will only use Relax NG syntax for the schemas and sub-schemas. Taking an example of others is not a problem. Example 6.1
Example 6.1. Alternate schema usage
<?xml version="1.0" encoding="utf-8"?>
<!-- syntax.ex1.nvdl -->
<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"
startMode="doc">
<mode name="doc">
<namespace ns="http://document">
<validate
message="A variant on the schema specification"
schemaType="application/x-rnc">
<schema>routing.1.rnc</schema>
</validate>
</namespace>
</mode>
<mode name="rest">
<namespace ns="http://head" >
<validate schema="routing.1.xsd" />
</namespace>
<namespace ns="http://body">
<validate schemaType="application/xml-dtd"
schema="routing.1.dtd" />
</namespace>
</mode>
</rules>
Due care though. The standard says, “If v contains a schema element as a child, its content is used as the schema. When the content is a string and v has the schemaType attribute, its value shall be a MIME mediatype (see IETF RFC2046) and be used for determining the schema language. When the content is a foreign element, its namespace is used for determining the schema language.” Put simply, if it's a modern XML based schema language, then you should be OK. Otherwise specify the mimetype as per RFC2046 (ietf rfc2046).