Feedback

  • Contents
 

XML Create Document From String

This XML tool parses the Data string as XML and returns a document representing the XML data

IMPORTANT: The XML string must contain one top-level element (root). The <?xml version=1.0"?> may be omitted. Thus, the simplest valid XML document (apart from an empty document) is <x/>.

Inputs

String Data

The data string to parse. The data string must contain valid XML to prevent parsing errors.

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 forces the validation of the document during parsing.

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

A string containing a whitespace-separated list of 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 toll 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.

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 occurs.

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.