Documentation Center

importNode

Description

Import a node from another document into the current document.

Example

The following example shows how importNode() can be used to insert a snippet of XML into a document.

var snippet = Editor.XML.createNativeXMLDocument("<paragraph>Hello World!</paragraph>");
var doc = Editor.getActiveDocument();
var imported = doc.importNode(snippet.documentElement, true);
doc.selectSingleNode("//*[paragraph]").appendChild(imported);

Syntax

XopusDocument .importNode (importedNode : Node, deep : Boolean) : XopusNode

Arguments

importedNode
Node. The node to be imported
deep
Boolean. true if childnodes should be imported also.

Return Value

XopusNode . The imported node.