XQuery Function Documentation

Search and Browse

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

validation:clear-grammar-cache() as xs:integer

Remove all cached grammers.

Returns:
xs:integer : the number of deleted grammars.

validation:jaxp

validation:jaxp($instance as item(), $cache-grammars as xs:boolean) as xs:boolean

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

validation:jaxp($instance as item(), $cache-grammars as xs:boolean, $catalogs as item()*) as xs:boolean

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

validation:jaxp-parse($instance as item(), $enable-grammar-cache as xs:boolean, $catalogs as item()*) as node()

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

validation:jaxp-report($instance as item(), $enable-grammar-cache as xs:boolean) as node()

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

validation:jaxp-report($instance as item(), $enable-grammar-cache as xs:boolean, $catalogs as item()*) as node()

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

validation:jaxv($instance as item(), $grammars as item()+) as xs:boolean

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

validation:jaxv($instance as item(), $grammars as item()+, $language as xs:string) as xs:boolean

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

validation:jaxv-report($instance as item(), $grammars as item()+) as node()

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

validation:jaxv-report($instance as item(), $grammars as item()+, $language as xs:string) as node()

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

validation:jing($instance as item(), $grammar as item()) as xs:boolean

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

validation:jing-report($instance as item(), $grammar as item()) as node()

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

validation:pre-parse-grammar($grammar as xs:anyURI*) as xs:string*

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

validation:show-grammar-cache() as node()

Show all cached grammars.

Returns:
node() : an XML document containing details on all cached grammars.