Difference between revisions of "Validation Module"

From BaseX Documentation
Jump to navigation Jump to search
(Initial)
 
(added signatures)
Line 6: Line 6:
  
 
==validate:xsd==
 
==validate:xsd==
 +
{|
 +
|-
 +
| valign='top' width='90' | '''Signatures'''
 +
|<code><b>validate:xsd</b>($input as item()) as empty-sequence()</code><br /><code><b>validate:xsd</b>($input as item(), $schema as xs:string) as empty-sequence()</code>
 +
|-
 +
|}
  
 
==validate:dtd==
 
==validate:dtd==
 +
{|
 +
|-
 +
| valign='top' width='90' | '''Signatures'''
 +
|<code><b>validate:dtd</b>($input as item()) as empty-sequence()</code><br /><code><b>validate:dtd</b>($input as item(), $dtd as xs:string) as empty-sequence()</code>
 +
|-
 +
|}
  
 
==Examples==
 
==Examples==

Revision as of 16:51, 21 May 2012

This XQuery Module contains functions to perform validations against XML Schema and Document Type Declarations . All functions are preceded by the validation: prefix, which is linked to the statically declared http://basex.org/modules/validation namespace.



validate:xsd

Signatures validate:xsd($input as item()) as empty-sequence()
validate:xsd($input as item(), $schema as xs:string) as empty-sequence()

validate:dtd

Signatures validate:dtd($input as item()) as empty-sequence()
validate:dtd($input as item(), $dtd as xs:string) as empty-sequence()

Examples

Example 1: Basic validation against a document containing a schema definition

Query:

validate:xsd($doc)