Arbortext Command Language > Functions by Alphabetical Listing > validate_against_schematron
  
validate_against_schematron
validate_against_schematron(sch_out[, doc[, sch_file[, output_file[, phase[, xpath_node]]]]])
This function is used to validate the document instance doc against a given list of Schematron files, defined by sch_file. If doc is not supplied or is 0, then the current document is used. If sch_file is not supplied, then the Schematron file for the instance’s document type is used. Each error reported by the Schematron is filled into an entry of the array sch_out. The array content is a string that contains both an XPath expression to the element in error and the error description from the Schematron file, separated by the | character. If output_file is specified and not empty, then the XML file with the Schematron results is saved to that file. If phase is supplied and not empty, then that value is passed as the phase parameter to the Schematron. If xpath_node is supplied and not empty, then the Schematron is only applied to the XPath node expressed by that variable.
For example, the following ACL call will validate the current document against the associated Schematron files axdocbook1.sch and axdocbook2.sch:
validate_against_schematron($S, 0, "axdocbook1.sch;axdocbook2.sch");
Note that the semi colon (;) is the required delimiter.
If the document or Schematron file is not valid, then the function returns -1. If any errors occur during the schema validation, then the function returns -1. Otherwise, the function returns the number of errors found, which is also the number of entries put into the sch_out array.
Related Topics
doc_type_schematron_file function
Specifying a Schematron File