<relaxng location = anyURI compactSyntax = boolean encoding =
any encoding supported byJava™ />
Use the RELAX NG schema specified by this element to constrain the document.
Required. Specifies the URL of the RELAX NG schema.
Specifies that the RELAX NG schema is written using the compact syntax. Without this attribute, if
location has a "
rnc" extension, the schema is assumed to use the compact syntax, otherwise it is assumed to use the XML syntax.
Specifies the character encoding used for a RELAX NG schema written using the compact syntax. Ignored if the XML syntax is used. Without this attribute, the schema is assumed to use the native encoding of the platform.
if a document contains a document type declaration (<!DOCTYPE>) which defines elements,
or if the root element of a document has
of if a document contains a
the grammar specified this way is used and the RELAX NG schema specified in the configuration file is ignored.
<relaxng location="rng/xhtml-strict.rng" />
Compact syntax example:
<relaxng compactSyntax="true" encoding="ISO-8859-1" location="example3.rnc" />
If your configuration allows to edit RELAX NG schemas, you'll typically specify:
<relaxng location="rng/relaxng.rng" />
rng/relaxng.rng is a copy of the RELAX NG schema for RELAX NG.
However, it is also possible to validate the document being edited using XXE's built-in schema validator. This kind of validation is more comprehensive than the one performed by the RELAX NG schema for RELAX NG alone. This is achieved by referencing the "
xxe-schema-for-relaxng" dummy URI:
<relaxng location="xxe-schema-for-relaxng" />
The same trick also applies to ISO Schematrons, which are normally validated against the RELAX NG schema for ISO Schematron (
iso-schematron.rnc). In this case, you'll have to reference the "
xxe-schema-for-schematron" dummy URI.