Errors that occur while parsing an XML text document to create a DOM tree or that occur while generating XML text from an existing DOM tree are accessed by properties of the associated XmlDoc object. The XmlDoc ErrorCode property contains the last error generated by a major XML operation. These operations include the LoadString and SaveString methods. Typically, such XML methods generate much more detailed error information than is reflected in a simple error code. If an XML method generates an error, the XmlDoc Message method should be examined for additional detailed error information.
For example, the error code -799 "XML error" has a secondary error number associated with it. To determine the meaning of the error, check the XmlDoc Message method.
Only severe parsing errors throw an exception, so it is required that the application software test the ErrorCode method after the LoadFile or LoadString methods are executed.
See the individual XmlNode dictionary pages for specifies on each method. In general, if a method returns an XmlNode value, the value will be set to Nothing if an error occurs, otherwise, the method throws an exception.
The error -801 "No XML node" occurs if you attempt to access a GPL XML object that is not associated with any XML tree node. This situation can occur if you have an XmlNode object that refers to a node, and then you remove the part of the XML tree that contains that node. For example, this can occur if you release the XmlDoc object that contains the entire document or you use the XmlNode RemoveChild method for the referenced node or one of its parents.