Feedback

  • Contents
 

XML Load Document

This XML tool loads the document as specified by the URL. The document is loaded synchronously. Thus, the tool blocks until the document is loaded and parsed completely. Note that the document may contain external DTD or Schema references that will be resolved too.

Inputs

URL or File Name

URL or file name of the document to load. For example, ‘C:\text.xml’ or ‘\\test\c\test.xml’.

Preserve Whitespace

Specifies whether whitespaces in the document are preserved. This flag specifies the default white space handling when the xml:space attribute is set to "default." When the parameter is true, all white space is preserved, regardless of the xml:space settings in the document. When false, the values of the xml:space attribute specified in the document determine whether white space is preserved or not.

Validate On Parse

Setting this argument to True will force the validation of the document during parse.

Resolve Externals

If this parameter is True, resolvable externals such as namespaces, DTD external subsets, and external entity references are resolved when the document is parsed.

Default Selection Namespaces

String containing a whitespace separated namespace prefix declarations to be used for XPath selection tools.

This is the same data as can be set using the SelectionNamespaces document property (see XML Set Document Property). Thus, this argument acts like invoking the XML Set Document Property tool right after this tool. However, you have to specify the selection namespaces here, in particular for read-only documents, as calling XML Set Document Property on read-only documents is not permitted.

Cache Document

If this box is checked, the document is cached based on the document URL (case sensitive!) and modification time. Cached documents are always read-only, irrespective of the ‘Read Only’ parameter.

The following parameter ‘Preserve Whitespace’, ‘Validate On parse’, ‘Resolve Externals’, and ‘Default Selection Namespaces’ are also used to identify the document in the cache. If the URL is a filename, the modification time is used too. Thus, after the file is modified, the next time the tool is invoked, a new document for the file is created and added to the cache. The previous document stays in the cache and is reclaimed if not accessed for about 10 minutes and no references to it are outstanding in other handler instances. Apart from making subsequent loads of the same document very efficient, caching has the advantage that documents that represent XSLT style-sheets are compiled and cached in a pre-compiled form the first time an XSLT function is invoked, so subsequent transformations with the same style-sheet are very efficient.

NOTE: Enabling document caching should not be used for documents that are changed frequently or very large documents, as the memory footprint of the process could be unacceptably inflated.

Read Only

When this box is checked, the XML Document tree cannot be modified. An error occurs when attempts are made to modify a read-only XML document. The box is unchecked by default.

Outputs

Document

The node of the document. The value is NULL if error other than parse error.

Document Element

The root element of the document. The value is NULL if document has no root element or an error occurred.

Exit Paths

Success

This path is taken if the document is successfully parsed.

Parse Error

This path is taken if an error occurs while parsing the data. Use the XML Get Error Info tool with the "Document" node as the argument to retrieve information about the error.

Failure

This path is taken if the operation fails for any reason other than a parsing error.