ext:validate-with-relax-ng
ext:validate-with-relax-ng — Returns the current working directory.
Synopsis
| ext:validate-with-relax-ng( | $node as node(), |
$schema as item()) as map(xs:string, item()) |
| ext:validate-with-relax-ng( | $node as node(), |
$schema as item(), | |
$options as map(xs:string, xs:string)) as map(xs:string, item()) |
Description
This extension function validates the node provided
against the schema. The schema can be either a
string (the URI of the RELAX NG grammar file) or a node (a RELAX NG grammar
document). There is no support for the RELAX NG Compact Syntax at this time.
The available options are assert-valid which defaults to
true()
and dtd-compatibility which isn’t actually supported yet.
If assert-valid is true() and the document is
not valid according to the grammar provided, an exception is raised.
If assert-valid is false(), or the document
is valid, the map returned will contain the following keys:
validA boolean indicating whether or not the document was valid.
documentThe validated document. Today, this always returns the same node, but it may eventually return an augmented document.
errorsAn array of maps containing the
type(warning,error, orfatal-error),message,line, andcolumnwhere an error occurred. If the document is valid, theerrorskey will not be present.