XMLTools
Validate
validate an XML document against a DTD
Calling Sequence
Parameters
Description
Examples
Validate(xmlDoc, opts)
xmlDoc
-
Maple XML tree; XML element to validate
opts
equation(s) of the form option=value where option is one of dtd or schema; specify validation options
The Validate(xmlDoc) command validates an XML element xmlDoc (typically the root element of an XML document). If xmlDoc is determined to be valid according to the specified DTD/schema, then Validate returns true. Otherwise, Validate returns an error containing a description of problems found in the document.
The opts argument must be one of the following.
dtd=location
Specifies the location of the DTD to be used.
schema=location
Specifies the target no namespace XML Schema Location. If present, xmlDoc's own noNamespaceSchemaLocation attribute is effectively ignored.
Note: If neither the dtd option nor the schema option is present, then xmlDoc is checked for well-formedness only.
with⁡XMLTools:
doc≔ParseFile⁡temp.xml
Validate⁡doc,schema=schema.xsd
See Also
XMLTools[ParseFile]
XMLTools[ParseString]
Download Help Document