Loads a XML Document into a DomDocument object from a file or an URL.


   filename STRING )
  1. filename defines a valid URL or the name of the file.


This method loads a XML Document into a DomDocument object from a file or an URL, where filename is a valid URL or the name of the file.

Only the following types of URLs are supported: http:// , https:// , tcp:// , tcps:// , file:/// and alias://. See Web Services FGLPROFILE configuration for more details about URL mapping with aliases, and for proxy and security configuration.

Use setFeature() to specify how the document can be loaded. HTML parsing is possible when enable-html-compliancy is enabled.

See getErrorsCount() and getErrorDescription() to retrieve error messages related to XML document.

Note: When loading a document, if xml.DomNode objects are still referenced in other variables of the program, the entire document is kept in memory. Otherwise, the DOM nodes of the document are deleted before loading the new document. For more details about object references and garbage collection in BDL, see Working with objects.

In case of error, the method throws an exception and sets the status variable. Depending on the error, a human-readable description of the problem is available in the sqlca.sqlerrm register. See Error handling in GWS calls (status).

Important: On Mac OS X® versions prior to 10.9, the libxml library (used by Genero Web Services classes) has a bug when parsing HTML documents. If you set the HTML compliancy option with CALL doc.setFeature("enable-html-compliancy",TRUE), loading an HTML document with xml.DomDocument.load() may produce additional blank TEXT nodes, because the libxml library loads some ignorable white-space nodes from the HTML document. Starting with Mac OS X 10.9, the libxml library of the system has fixed this bug.