<relaxng
location = anyURI
compactSyntax = boolean
encoding = any encoding supported by
Java™
/>
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.
Note that
if a document contains a document type declaration (<!DOCTYPE>) which defines elements,
or if the root element of a document has xsi:schemaLocation
/xsi:noNamespaceSchemaLocation
attributes,
of if a document contains a <?xml-model href="..."?>
,
the grammar specified this way is used and the RELAX NG schema specified in the configuration file is ignored.
Example:
<relaxng location="rng/xhtml-strict.rng" />
Compact syntax example:
<relaxng compactSyntax="true" encoding="ISO-8859-1" location="example3.rnc" />
Validating RELAX NG schema or ISO Schematrons | |
---|---|
If your configuration allows to edit RELAX NG schema, you'll typically specify: <relaxng location="rng/relaxng.rng" /> where 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 " <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 ( |