Try OpenEdge Now
skip to main content
Working with XML
Reading and Writing XML with the Document Object Model (DOM) : Error handling

Error handling

Any of the methods listed above may fail, but this does not normally raise the ABL ERROR condition. Instead, the method returns FALSE if that is appropriate. Also, the parsing may encounter errors that do not cause the operation as a whole to fail. So instead of testing for ERROR-STATUS:ERROR after running a method with NO-ERROR, you should test for ERROR-STATUS:NUM-MESSAGES being greater than zero.
If the block containing the method calls includes a CATCH statement, any method that would would normally add a message to ERROR-STATUS:NUM-MESSAGES after encountering a parsing error will raise the ERROR condition and the AVM will generate a Progress.Lang.SysError error object containing the message. For information on using CATCH statements. built-in method error handling, and structured error handling, see OpenEdge Development: Error Handling.
Note that the DOM parser may detect errors in an input XML document even if validation is not specified in the LOAD( ) method call. Validation checks the document for conformance to a DTD, but there could be other errors, such a missing end-tag or mismatched tags. The parser will report these errors independently of validation against a DTD.