User Guide
926 Chapter 3: ColdFusion Functions
XmlValidate
Description
Uses a Document Type Definition (DTD) or XML Schema to validate an XML text document or
an XML document object.
Returns
The following validation structure:
Category
XML functions
Function syntax
XmlValidate(xmlDoc[, validator])
See also
cfxml
, IsXmlDoc, IsXML, XmlFormat, XmlNew, XmlParse, XmlSearch, XmlTransform;
Chapter 35, “Using XML and WDDX” in ColdFusion MX Developer’s Guide
History
ColdFusion MX 7: Added this function.
Parameters
Field Description
Errors An array containing any validator error messages. These messages indicate that
the document does not conform to the DTD or Schema (is not valid).
FatalErrors An array containing any validator fatal error messages. Fatal errors indicate that
the document contains XML formatting errors (is not well-formed XML).
Status A Boolean value:
• True if the document is valid.
• False if the validation check failed.
Warning An array containing any validator warnings. A well-formed and valid document
can produce warning messages.
Parameter Description
xmlDoc Any of the following:
• A string containing an XML document.
• The name of an XML file.
• The URL of an XML file; valid protocol identifiers include http, https, ftp, and
file.
• An XML document object, such as one generated by the
XmlParse function.
validator Any of the following:
• A string containing a DTD or Schema.
• The name of a DTD or Schema file.
• The URL of a DTD or Schema file; valid protocol identifiers include http, https,
ftp, and file.