You are here: Reference Guides > Javascript Support > SVXmlDocument

SVXmlDocument

A wrapper around a JavaScript XML document object. It has the following functions:

Function

Description

Arguments

getParseError

Returns the parse error from the underlying XML document.

None.

getDocumentElement

Returns an SVXmlNode representing the root document element.

None.

transformNode

Transforms this node's XML by using the XSL stylesheet passed as the argument.

xslDocument — an SVXmlDocument loaded with the XSL stylesheet.

setPreserveWhiteSpace

A Boolean expression indicating whether to preserve whitespace or not.

preserve — true or false.

loadXml

Loads the given XML into the underlying XML document.

xml — the XML string to load.

getXml

Returns the XML string currently loaded.

None.

selectSingleNode

Returns an SVXmlNode retrieved based on the given XPath, or null if the path does not exist.

xpath — the XPath used to retrieve the node.


selectNodes

Returns an array of SVXmlNodes retrieved based on the given XPath, or an empty array if no nodes exist at the given path.

xpath — the XPath used to retrieve the nodes.

setProperty

Sets the property with the given name to the given value.

name — the name of the property.

value — the value to associate with the property name.

importNode

Incorporates the given node into the current SVXmlDocument.

node — the SVXmlNode to incorporate into the current document.

deep — a Boolean expression indicating whether to recursively import all nodes that descend from the given node.