Error Handling

When an XML document is loaded, an instance of the parseError object is created. Since it's part of the XML object, it's accessed using the following notation:

          xmlDoc1.parseError

A parsing error is an error that occurs when the xmldom object is processing the XML file and the structure doesn't satisfy the design parameters.

The parseError object contains several properties, all of which store characteristics of the last parsing error that was generated by the xmldom object running in your HTML program. Table 7.2 contains a list of properties of the parseError object.

Table 7.2. The Properties of the parseError Object
PropertyData TypeExplanation
errorCodeLong integerContains the error code of the last parsing error
filePosLong ...

Get Sams Teach Yourself XML in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.