VALIDATE

The VALIDATE function validates the XML input by using the XMLLIB library.

This function validates XML input, which is provided as a text stream or URL, against the provided XML Schema, returning 0 if the validation succeeded or -1 otherwise.

Syntax:
VALIDATE (single-text-expression, single-text-expression)
Meaning:
VALIDATE (xml_url_or_xml_fragment, target_namespace XML_schemaname)
Returns:
A single number

Examples

  • NUMBERTOTEXT( xmllib->VALIDATE( "ipo.in.xml", "urn:hl7-org:v3 http://www.example.com/IPO ipo.xsd" ) )

    Returns 0 when validation of the ipo.in.xml file succeeds and returns -1 otherwise.

  • VALID( NUMBERTOTEXT( xmllib->VALIDATE( PACKAGE(source), "ipo.xsd" ) ), LASTERRORMSG() )

    Returns 0 when validation of the input XML fragment succeeds or returns a validation error message otherwise.


Feedback