DOMNode methods

The DOMNode interface supports the following methods:

appendChild(nodeNewChild) 
Returns  DOMNode 
Description  Adds the node nodeNewChild to the end of the list of children of this node. If nodeNewChild already exists, it is removed first. Not implemented. 
Usage 
JScript  DOMNode_object.appendChild(nodeNewChild);  
VBScript  DOMNode_object.insertBefore(nodeNewChild) 

cloneNode(booleanDeep) 
Returns  DOMNode 
Description  Returns a duplicate of this node. The duplicate node has no parent. Cloning a DOMElement copies all attributes and their values, including those generated by the processor to represent defaulted attributes. If booleanDeep is set to true, a recursive clone of the subtree under the specified node is done. If it is set to false, only the node itself is cloned. Not implemented. 
Usage 
JScript  DOMNode_object.clone(booleanDeep);  
VBScript  DOMNode_object.clone(booleanDeep) 

hasChildNodes 
Returns  Boolean 
Description  Returns true if the node has children, andfalse otherwise. 
Usage 
JScript  DOMNode_object.hasChildNodes();  
VBScript  DOMNode_object.hasChildNodes 
Example 
// SoftQuad Script Language JSCRIPT:
var docElem=ActiveDocument.documentElement;
Application.Alert(docElem.hasChildNodes());
 

insertBefore(nodeNewChild, nodeRefChild)  
Returns  DOMNode 
Description  Inserts the node nodeNewChild before the existing child node nodeRefChild. If nodeRefChild is null, then inserts nodeNewChild at the end of the list of children. Not implemented. 
Usage 
JScript  DOMNode_object.insertBefore(nodeNewChild, nodeRefChild);  
VBScript  DOMNode_object.insertBefore(nodeNewChild, nodeRefChild) 

removeChild(nodeChildToRemove) 
Returns  DOMNode  
Description  Removes and returns the child node indicated by nodeChildToRemove. Not implemented. 
Usage 
JScript  DOMNode_object.removeChild(nodeChildToRemove)  
VBScript  DOMNode_object.removeChild(nodeChildToRemove) 

replaceChild(nodeNewChild, nodeOldChild)  
Returns  DOMNode 
Description  Replaces the child node nodeOldChild with nodeNewChild in the list of children, and returns nodeOldChild. Not implemented. 
Usage 
JScript  DOMNode_object.replaceChild(nodeNewChild, nodeOldChild);  
VBScript  DOMNode_object.replaceChild(nodeNewChild, nodeOldChild) 


Right arrow
Next Topic
Left arrow
Previous Topic
Table of contents
Table of Contents

Copyright © SoftQuad Software Inc. 1999