XQuery Function Documentation
http://exist-db.org/xquery/validation
java:org.exist.xquery.functions.validation.ValidationModule
A module for XML validation and grammars functions.
validation:clear-grammar-cache
Remove all cached grammers.
- Returns:
- xs:integer : the number of deleted grammars.
validation:jaxp
Validate document by parsing $instance. Optionally grammar caching can be enabled. Supported grammars types are '.xsd' and '.dtd'.
- Parameters:
-
$instance The document referenced as xs:anyURI, a node (element or result of fn:doc()) or as a Java file object. $cache-grammars Set the flag to true() to enable grammar caching. - Returns:
- xs:boolean : true() if the document is valid and no single problem occured, false() for all other conditions. For detailed validation information use the corresponding -report() function.
validation:jaxp
Validate document by parsing $instance. Optionally grammar caching can be enabled and an XML catalog can be specified. Supported grammars types are '.xsd' and '.dtd'.
- Parameters:
-
$instance The document referenced as xs:anyURI, a node (element or result of fn:doc()) or as a Java file object. $cache-grammars Set the flag to true() to enable grammar caching. $catalogs* The catalogs referenced as xs:anyURI's. - Returns:
- xs:boolean : true() if the document is valid and no single problem occured, false() for all other conditions. For detailed validation information use the corresponding -report() function.
validation:jaxp-parse
Parse document in validating mode, all defaults are filled in according to the grammar (xsd).
- Parameters:
-
$instance The document referenced as xs:anyURI, a node (element or result of fn:doc()) or as a Java file object. $enable-grammar-cache Set the flag to true() to enable grammar caching. $catalogs* The catalogs referenced as xs:anyURI's. - Returns:
- node() : the parsed document.
validation:jaxp-report
Validate document by parsing $instance. Optionally grammar caching can be enabled. Supported grammars types are '.xsd' and '.dtd'. An XML report is returned.
- Parameters:
-
$instance The document referenced as xs:anyURI, a node (element or result of fn:doc()) or as a Java file object. $enable-grammar-cache Set the flag to true() to enable grammar caching. - Returns:
- node() : a validation report.
validation:jaxp-report
Validate document by parsing $instance. Optionally grammar caching can be enabled and an XML catalog can be specified. Supported grammars types are '.xsd' and '.dtd'. An XML report is returned.
- Parameters:
-
$instance The document referenced as xs:anyURI, a node (element or result of fn:doc()) or as a Java file object. $enable-grammar-cache Set the flag to true() to enable grammar caching. $catalogs* The catalogs referenced as xs:anyURI's. - Returns:
- node() : a validation report.
validation:jaxv
Validate document specified by $instance using the schemas in $grammars. Based on functionality provided by 'javax.xml.validation.Validator'. Only '.xsd' grammars are supported.
- Parameters:
-
$instance The document referenced as xs:anyURI, a node (element or returned by fn:doc()) or as a Java file object. $grammars+ The namespace URI to designate a schema language. Depending on the jaxv.SchemaFactory implementation the following values are valid:(XSD 1.0) http://www.w3.org/2001/XMLSchema http://www.w3.org/XML/XMLSchema/v1.0, (XSD 1.1) http://www.w3.org/XML/XMLSchema/v1.1, (RELAX NG 1.0) http://relaxng.org/ns/structure/1.0 - Returns:
- xs:boolean : true() if the document is valid and no single problem occured, false() for all other conditions. For detailed validation information use the corresponding -report() function.
validation:jaxv
Validate document specified by $instance using the schemas in $grammars. Based on functionality provided by 'javax.xml.validation.Validator'. Only '.xsd' grammars are supported.
- Parameters:
-
$instance The document referenced as xs:anyURI, a node (element or returned by fn:doc()) or as a Java file object. $grammars+ One of more XML Schema documents (.xsd), referenced as xs:anyURI, a node (element or returned by fn:doc()) or as Java file objects. $language The namespace URI to designate a schema language. Depending on the jaxv.SchemaFactory implementation the following values are valid:(XSD 1.0) http://www.w3.org/2001/XMLSchema http://www.w3.org/XML/XMLSchema/v1.0, (XSD 1.1) http://www.w3.org/XML/XMLSchema/v1.1, (RELAX NG 1.0) http://relaxng.org/ns/structure/1.0 - Returns:
- xs:boolean : true() if the document is valid and no single problem occured, false() for all other conditions. For detailed validation information use the corresponding -report() function.
validation:jaxv-report
Validate document specified by $instance using the schemas in $grammars. Based on functionality provided by 'javax.xml.validation.Validator'. Only '.xsd' grammars are supported. An XML report is returned.
- Parameters:
-
$instance The document referenced as xs:anyURI, a node (element or returned by fn:doc()) or as a Java file object. $grammars+ One of more XML Schema documents (.xsd), referenced as xs:anyURI, a node (element or returned by fn:doc()) or as Java file objects. - Returns:
- node() : a validation report.
validation:jaxv-report
Validate document specified by $instance using the schemas in $grammars. Based on functionality provided by 'javax.xml.validation.Validator'. Only '.xsd' grammars are supported. An XML report is returned.
- Parameters:
-
$instance The document referenced as xs:anyURI, a node (element or returned by fn:doc()) or as a Java file object. $grammars+ One of more XML Schema documents (.xsd), referenced as xs:anyURI, a node (element or returned by fn:doc()) or as Java file objects. $language The namespace URI to designate a schema language. Depending on the jaxv.SchemaFactory implementation the following values are valid:(XSD 1.0) http://www.w3.org/2001/XMLSchema http://www.w3.org/XML/XMLSchema/v1.0, (XSD 1.1) http://www.w3.org/XML/XMLSchema/v1.1, (RELAX NG 1.0) http://relaxng.org/ns/structure/1.0 - Returns:
- node() : a validation report.
validation:jing
Validate document using 'Jing'. Supported grammar documents extensions are ".xsd" ".rng" ".rnc" ".sch" and ".nvdl". Based on functionality provided by 'com.thaiopensource.validate.ValidationDriver'.
- Parameters:
-
$instance The document referenced as xs:anyURI, a node (element or returned by fn:doc()) or as a Java file object. $grammar The grammar document as node (element of returned by fn:doc()), xs:anyURI, returned by util:binary-doc() or as a Java file object. - Returns:
- xs:boolean : true() if the document is valid and no single problem occured, false() for all other conditions. For detailed validation information use the corresponding -report() function.
validation:jing-report
Validate document using 'Jing'. Supported grammar documents extensions are ".xsd" ".rng" ".rnc" ".sch" and ".nvdl". Based on functionality provided by 'com.thaiopensource.validate.ValidationDriver'. An XML report is returned.
- Parameters:
-
$instance The document referenced as xs:anyURI, a node (element or returned by fn:doc()) or as a Java file object. $grammar The grammar document as node (element of returned by fn:doc()), xs:anyURI, returned by util:binary-doc() or as a Java file object. - Returns:
- node() : a validation report.
validation:pre-parse-grammar
Pre parse grammars and add to grammar cache. Only XML schemas (.xsd) are supported.
- Parameters:
-
$grammar* Reference to grammar. - Returns:
- xs:string* : sequence of namespaces of preparsed grammars.
validation:show-grammar-cache
Show all cached grammars.
- Returns:
- node() : an XML document containing details on all cached grammars.
validation:validate
Validate XML. The grammar files (DTD, XML Schema) are resolved using the global catalog file(s).
- Parameters:
-
$instance The document referenced as xs:anyURI or a node (element or returned by fn:doc()) - Returns:
- xs:boolean : true() if the document is valid and no single problem occured, false() for all other conditions. For detailed validation information use the corresponding -report() function.
- Deprecated:
- This is the original and oldest validation function of eXist-db. It basically wraps the jing library for .rnc/.rnc/.sch/.nvdl grammar files and uses the jaxp functionality otherwise. It is recommended to use the validation:jaxp-parse(), validation:jaxv() or validation:jing() functions instead. This function could be removed in the next major release version.
validation:validate
Validate XML by using a specific grammar.
- Parameters:
-
$instance The document referenced as xs:anyURI or a node (element or returned by fn:doc()) $grammar The reference to an OASIS catalog file (.xml), a collection (path ends with '/') or a grammar document. Supported grammar documents extensions are ".dtd" ".xsd" ".rng" ".rnc" ".sch" and ".nvdl". The parameter can be passed as an xs:anyURI or a document node. - Returns:
- node() : true() if the document is valid and no single problem occured, false() for all other conditions. For detailed validation information use the corresponding -report() function.
- Deprecated:
- This is the original and oldest validation function of eXist-db. It basically wraps the jing library for .rnc/.rnc/.sch/.nvdl grammar files and uses the jaxp functionality otherwise. It is recommended to use the validation:jaxp-parse(), validation:jaxv() or validation:jing() functions instead. This function could be removed in the next major release version.
validation:validate-report
Validate XML. The grammar files (DTD, XML Schema) are resolved using the global catalog file(s). An XML report is returned.
- Parameters:
-
$instance The document referenced as xs:anyURI or a node (element or returned by fn:doc()) - Returns:
- node() : a validation report.
- Deprecated:
- This is the original and oldest validation function of eXist-db. It basically wraps the jing library for .rnc/.rnc/.sch/.nvdl grammar files and uses the jaxp functionality otherwise. It is recommended to use the validation:jaxp-parse-report(), validation:jaxv-report() or validation:jing-report() functions instead. This function could be removed in the next major release version.
validation:validate-report
Validate XML by using a specific grammar. An XML report is returned.
- Parameters:
-
$instance The document referenced as xs:anyURI or a node (element or returned by fn:doc()) $grammar The reference to an OASIS catalog file (.xml), a collection (path ends with '/') or a grammar document. Supported grammar documents extensions are ".dtd" ".xsd" ".rng" ".rnc" ".sch" and ".nvdl". The parameter can be passed as an xs:anyURI or a document node. - Returns:
- node() : a validation report.
- Deprecated:
- This is the original and oldest validation function of eXist-db. It basically wraps the jing library for .rnc/.rnc/.sch/.nvdl grammar files and uses the jaxp functionality otherwise. It is recommended to use the validation:jaxp-parse-report(), validation:jaxv-report() or validation:jing-report() functions instead. This function could be removed in the next major release version.