A.3 DOM Methods

This section lists all DOM-related methods and properties supported by the ECMA Expression Builder, including not only DOM-1 and DOM-2 extensions (defined by the relevant W3C standards), but also Designer’s own ECMAScript extensions. Extension methods are specifically noted as such in the text. DOM methods are displayed in the ECMA Expression Builder when you are working with expressions in the Integration activity.

A.3.1 Node

Lets you work with nodes.

attributes

W3C DOM Level 1 Node property. This property returns a NamedNodeMap object of the attributes for the Node.

childNodes

W3C DOM Level 1 Node property. This property returns a NodeList object consisting of the immediate children of the Node.

firstChild

W3C DOM Level 1 Node property. This property returns the first child node of a Node object.

lastChild

W3C DOM Level 1 Node property. This property returns the last child node of a Node object.

nextSibling

W3C DOM Level 1 Node property. This property returns the next sibling node for a Node object.

nodeName

W3C DOM Level 1 Node property. This property returns the node name as a String object.

nodeType

W3C DOM Level 1 Node property. This property returns the node type as a short in with one of the following values:

  • 1 = Element
  • 2 = Attribute
  • 3 = Text
  • 4 = CDATASection
  • 5 = EntityReference
  • 6 = Entity
  • 7 = ProcessingInstruction
  • 8 = Comment
  • 9 = Document
  • 10 = DocumentType
  • 11 = DocumentFragment
  • 12 = Notation

nodeValue

W3C DOM Level 1 Node property. This property returns the node text data as a String.

ownerDocument

W3C DOM Level 1 Node property. This property returns a Document object.

parentNode

W3C DOM Level 1 Node property. This property returns the parent node object for a Node object.

previousSibling

W3C DOM Level 1 Node property. This property returns the previous sibling node for a Node object.

XML

Designer extension property. This property returns a string representing the DOM. Useful in Log actions for debugging components (for example, Input.XML).

appendChild(newChild)

Node appendChild(newChild)

W3C DOM Level 1 Node method. Appends a node as the last child for a Node. The newChild parameter is of type Node.

cloneNode(deep)

Node cloneNode(deep)

W3C DOM Level 1 Node method. Creates an unattached Node object. The deep parameter is of type Boolean.

createXPath(XPathType asPattern)

Object createXPath(XPathType asPattern)

ECMAScript extension method. Creates the XPath pattern. The XPath Type asPattern parameter supports only abbreviated XPath notation and explicit ordinals. XPath functions are not supported.

hasChildNodes()

boolean hasChildNodes()

W3C DOM Level 1 Node method. Returns a Boolean indicating whether the node has children.

insertBefore(newChild, refChild)

Node insertBefore(newChild, refChild)

W3C DOM Level 1 Node method. Inserts a node object into the parent node before the refChild node. The newChild parameter is of type Node. The refChild parameter is of type Node.

removeChild(oldChild)

Node removeChild(oldChild)

W3C DOM Level 1 Node method. Removes a node from a parent and returns an unattached node. The oldChild parameter is of type Node.

replaceChild(newChild, oldChild)

Node replaceChild(newChild, oldChild)

W3C DOM Level 1 Node method. Replaces one node with another node. The newChild parameter is of type Node. The oldChild parameter is of type Node.

getXML()

String getXML()

ECMAScript extension method. This property returns a string representing the DOM. Useful in Log actions for debugging components. Example:

Input.XPath("root/child").getXML()

ownerDocument

W3C DOM Level 2 modified Node property. Returns the Document object associated with this node. This is also the Document object used to create new nodes. Example:

someNodeObject.ownerDocument

namespaceURI

W3C DOM Level 2 Node property. Returns the namespace URI of this node, or null if the namespace URI is not specified. Example:

someNodeObject.namespaceURI

prefix

W3C DOM Level 2 Node property. Returns the namespace prefix of this node, or null if the namespace prefix is not specified. Example:

someNodeObject.prefix

localName

W3C DOM Level 2 Node property. Returns the local part of the qualified name of this node. Example:

someNodeObject.localName

normalize()

void normalize()

W3C DOM Level 2 modified Node method. Puts all Text nodes in the full depth of the subtree underneath this Node, including attribute nodes, into a “normal” form in which only structure separates Text nodes, (for example, elements, comments, processing instructions, CDATA sections, and entity references). In other words, there are neither adjacent Text nodes nor empty Text nodes.

hasAttributes()

boolean hasAttributes()

W3C DOM Level 2 Node method. Returns True if the node has any attributes; otherwise, returns False. Example:

Temp.XPath("A/B/C").item(0).hasAttributes()

isSupported(feature, version)

boolean isSupported(feature, version)

W3C DOM Level 2 Node method. Returns True if the specified feature is supported on this node; otherwise, returns False.

Table A-7 Parameters of the IsSupported Method

Parameter

Features

feature

  • Core
  • XML
  • HTML
  • Views
  • Stylesheets
  • CSS
  • CSS2
  • Events
  • UIEvents
  • MouseEvents
  • MutationEvents
  • HTMLEvents
  • Range
  • Transversal

version

Specifies the version number of the feature to test. In Level 2, version 1, this is the string “2.0”. If the version is not specified, supporting any version of the feature causes the method to return True.

Example:

 aNodeObject.isSupported("Core","2.0")

A.3.2 Document

Lets you work with documents.

doctype

W3C DOM Level 1 Document property. This property returns a DocumentType object reflecting the DTD for the document. A Document also has all the properties and methods of Node.

documentElement

W3C DOM Level 1 Document property. This property returns an Element object (the root element). A Document also has all the properties and methods of Node.

implementation

W3C DOM Level 1 Document property. This property returns a DOMImplementation object. A Document also has all the properties and methods of Node.

text

Designer extension property. This property returns a concatenated string of all the text nodes (content) under it.

createAttribute(name)

Attr createAttribute(name)

W3C DOM Level 1 Document method. Returns an unattached Attr object. The name parameter is of type String. A Document also has all the properties and methods of Node.

createCDATASection(data)

CDATASection createCDATASection(data)

W3C DOM Level 1 Document method. Returns an unattached CDATASection object. The data parameter is of type String. A Document also has all the properties and methods of Node.

createComment(data)

Comment createComment(data)

W3C DOM Level 1 Document method. Returns an unattached Comment object. The data parameter is of type String. A Document also has all the properties and methods of Node.

createDocumentFragment()

DocumentFragment createDocumentFragment()

W3C DOM Level 1 Document method. Returns an unattached DocumentFragment. A Document also has all the properties and methods of Node.

createElement(tagName)

Element createElement(tagName)

W3C DOM Level 1 Document method. Creates an unattached Element. The tagName parameter is of type String. A Document also has all the properties and methods of Node.

createEntityReference(name)

EntityReference createEntityReference(name)

W3C DOM Level 1 Document method. Creates an unattached EntityReference. The name parameter is of type String. A Document also has all the properties and methods of Node.

createProcessingInstruction(target,data)

ProcessingInstruction createProcessingInstruction(target,data)

W3C DOM Level 1 Document method. Returns an unattached ProcessingInstruction object. The target and data parameters are of type String. A Document also has all the properties and methods of Node.

createTextNode(data)

Text createTextNode(data)

W3C DOM Level 1 Document method. Creates an unattached Text object. The data parameter is of type String. A Document also has all the properties and methods of Node.

getElementsByTagName(tagName)

NodeList getElementsByTagName(tagName)

W3C DOM Level 1 Document method. Returns a NodeList object consisting of the tagname element nodes. The tagName parameter is of type String. A Document also has all the properties and methods of Node.

reset()

void reset()

W3C DOM Level 1 Document method. Clears the document.

setDTD(Node RootElementName, Object PublicName, Object URL)

setDTD(Node RootElementName, Object PublicName, Object URL)

ECMAScript extension method. Sets the DTD file for the document.

setValue(Object aValue)

setValue(Object aValue)

ECMAScript extension method. Sets the Value of a document from the passed objects. If the passed object is another document, then it copies child nodes (elements and attributes). If the passed object is text, the text is parsed to create a DOM.

toString()

String toString()

ECMAScript extension method. Converts a DOM document to an XML formatted string.

Example:

Input.XPath("root/child").item(0).toString()

XPath(String asPattern)

NodeList XPath(XPathType asPattern)

ECMAScript extension method. XPathTypes can be of type NodeList, String, Number, or Boolean. Usually used to return a NodeList matching the XPath pattern. Use brackets to select a particular node from the list. For example, Input.XPath("INVOICE/LINEITEM[1]") or Input.XPath("INVOICE/LINEITEM[last()]"). Use the @ symbol to select a node by attribute. For example, Input.XPath("INVOICE/LINEITEM[@myattr]") To select by attribute value: Input.XPath("INVOICE/LINEITEM[@myattr='abc']").

importNode(sourceNode, deep)

Node importNode(sourceNode, deep)

W3C DOM Level 2 Document method. Imports a node from a document to the current document. Creates a new copy of the sourceNode. The sourceNode is not altered. A Document also has all the properties and methods of Node.

Table A-8 Parameters for the ImportNode Method

Parameter

Description

sourceNode

The node to import.

deep

A Boolean. If True, recursively import the subtree under the specified node. If False, import only the node itself.

Example:

Temp.importNode(Input.XPath("A/B[2]"), false)

createElementNS(namespaceURI, qualifiedName)

Element createElementNS(namespaceURI, qualifiedName)

W3C DOM Level 2 Document method. Creates an Element of the given qualifiedName and namespaceURI. A Document also has all the properties and methods of Node.

Table A-9 Parameters for the createElementNS Method

Parameter

Description

namespaceURI

A string representing the namespace URI that you want to create for the element.

qualifiedName

A string representing the name to create for the element. qualifiedName = namespaceprefix + : + localName

Example:

Temp.createElementNS("someURI","nsprefix:PRICE")

createAttributeNS(namespaceURI, qualifiedName)

Attr createAttributeNS(namespaceURI, qualifiedName)

W3C DOM Level 2 Document method. Creates an Attribute of the given qualifiedName and namespaceURI. A Document also has all the properties and methods of Node.

Table A-10 Parameters for the createAttributeNS Method

Parameter

Description

namespaceURI

A string representing the namespace URI that you want to create for the attribute.

qualifiedName

A string representing the name to create for the attribute. qualifiedName = namespaceprefix + : + localName

Example:

Temp.createAttributeNS("someURI","nsprefix:PRICE")

getElementsByTagNameNS(namespaceURI, localName)

NodeList getElementsByTagNameNS(namespaceURI, localName)

W3C DOM Level 2 Document method. Returns a NodeList of all the Elements with a given localName and namespaceURI, in the order in which they are encountered in a preorder traversal of the Document tree. A Document also has all the properties and methods of Node.

Table A-11 Parameters for the getElementsByTagnameNS Method

Parameter

Description

namespaceURI

A string of the elements on which to match. The special value “*” matches all namespaces.

qualifiedName

A string of the elements on which to match. The special value “*” matches all local names.

Example:

Temp.getElementsByTagNameNS("someURI", "someName")

getElementById(elementId)

Element getElementById(elementId)

W3C DOM Level 2 Document method. Returns the Element for which the ID is given by elementId. If no such element exists, returns null. Behavior is not defined if more than one element has this ID. A Document also has all the properties and methods of Node.

Example;

Temp.getElementById("someId")

setSkipNameSpaces(abFlag)

void setSkipNameSpaces(boolean flag)

Can be used to turn off usage of namespaces and match nodes without any prefixes, behaving like a wildcard match.

setEncoding(encoding)

void setEncoding(String encoding)

Sets the character set encoding for the document.

A.3.3 Element

Lets you work with elements.

tagName

W3C DOM Level 1 Element property. This property returns a String object containing the element name. An Element also has all the properties and methods of Node.

text

Designer extension property. This property returns the concatenated text of all the text nodes under it.

booleanValue()

boolean booleanValue()

ECMAScript extension method. Returns the Boolean value (True or False) of this object, if possible.

countOfElement(String propertyName)

Number countOfElement(String propertyName)

ECMAScript extension method. Returns a count of the named child.

doubleValue()

double doubleValue()

ECMAScript extension method. Returns a double value for this object if possible.

exists(String propertyName)

Boolean exists(String propertyName)

ECMAScript extension method. Checks for the existence of the named child.

getAttribute(name)

String getAttribute(name)

W3C DOM Level 1 Element method. Returns a String consisting of the attribute value. The name parameter is of type String. An Element also has all the properties and methods of Node.

getAttributeNode(name)

Attr getAttributeNode(name)

W3C DOM Level 1 Element method. Returns an Attr. The name parameter is of type String. An Element also has all the properties and methods of Node.

getElementsByTagName(name)

NodeList getElementsByTagName(name)

W3C DOM Level 1 Element method. Returns a NodeList of all elements with a specified name. The name parameter is of type String. An Element also has all the properties and methods of Node.

getIndex()

int getIndex()

ECMAScript extension method. Returns the current index.

getParent()

Node getParent()

ECMAScript extension method. Returns the parent element.

normalize()

void normalize()

W3C DOM Level 1 Element method. Returns a void. An Element also has all the properties and methods of Node.

removeAttribute(name)

void removeAttribute(name)

W3C DOM Level 1 Element method. Removes an attribute from an element. The name parameter is of type String. An Element also has all the properties and methods of Node.

removeAttributeNode(oldAttr)

Attr removeAttributeNode(oldAttr)

W3C DOM Level 1 Element method. Removes an attribute from an element and returns an unattached Attr. The oldAttr parameter is of type Attr. An Element also has all the properties and methods of Node.

setAttribute(name,value)

void setAttribute(name, value)

W3C DOM Level 1 Element method. Sets the value of an attribute node for an element. The name parameter is of type String. The value parameter is of type String. An Element also has all the properties and methods of Node.

setAttributeNode(newAttr)

Attr setAttributeNode(newAttr)

W3C DOM Level 1 Element method. Attaches an attribute node to an element. The newAttr parameter is of type Attr. An Element also has all the properties and methods of Node.

setIndex(int aiIndex)

setIndex(int aiIndex)

ECMAScript extension method. Sets the iterator index value for this element.

setText(String asText)

setText(String asText)

ECMAScript extension method. Sets the text node associated with this element.

setValue(Object aValue)

setValue(Object aValue)

ECMAScript extension method. Sets the value of an element from the passed object. If the passed object is another element, then it also copies child nodes (elements and attributes).

toNumber()

Number toNumber()

ECMAScript extension method. Gets the text node and converts it to a number.

toString()

String toString()

ECMAScript extension method. Gets the text node associated with this element.

XPath(XPathType asPattern)

NodeList XPath(XPathType asPattern)

ECMAScript extension method. The XPathType parameter can be of type NodeList, String, Number, or Boolean. Usually used to return a Nodelist matching the XPath pattern. Use brackets to select a particular node from the list. For example, Input.XPath("INVOICE/LINEITEM[1]") or Input.XPath("INVOICE/LINEITEM[last()]"). Use the @ symbol to select a node by attribute. For example, Input.XPath("INVOICE/LINEITEM[@myattr]"). To select by attribute value: Input.XPath("INVOICE/LINEITEM[@myattr='abc']").

getAttributeNS(namespaceURI, localName)

string getAttributeNS(namespaceURI, localName)

W3C DOM Level 2 Element method. Returns the Attr value as a string. An Element also has all the properties and methods of Node.

Table A-12 Parameters for the getAttributeNS Method

Parameter

Description

namespaceURI

Specifies a string representing the namespace URI of the target Attr.

localName

Specifies a string of the localName of the target Attr.

Example:

Temp.XPath("A/B[0]").getAttributeNS("someURI", "someAttr")

setAttributeNS(namespaceURI, qualifiedName, value)

void setAttributeNS(namespaceURI, qualifiedName, value)

W3C DOM Level 2 Element method. Adds a new attribute. If an attribute with the same namespaceURI and localName is already present in the element, its prefix is changed to be the prefix part of the qualifiedName parameter, and its value is changed to be the value parameter. An Element also has all the properties and methods of Node.

Table A-13 Parameters for the setAttributeNS Method

Parameter

Description

namespaceURI

The namespace URI of the attribute to create or alter.

qualifiedName

Specifies the qualified name of the attribute to create or alter.

HINT:qualifiedName = namespaceprefix + : + localName

value

Specifies the value to set in string form.

Example:

Temp.XPath("A/B[0]").setAttributeNS("someURI", "someAttrName", "someAttrvalue")

removeAttributeNS(namespaceURI, localName)

void removeAttributeNS(namespaceURI,localName)

W3C DOM Level 2 Element method. Removes an attribute by local name and namespace URI. If the removed attribute has a default value, it is immediately replaced. The replacing attribute has the same namespace URI and local name, as well as the original prefix. An Element also has all the properties and methods of Node.

Table A-14 Parameters for the removeAttributeNS Method

Parameter

Description

namespaceURI

Specifies the namespaceURI of the attribute to remove.

localName

Specifies the name of the attribute to remove.

Example:

Temp.XPath("A/B[0]").removeAttributeNS("someURI", "someAttrName") 

getAttributeNodeNS(namespaceURI, localName)

Attr getAttributeNodeNS(namespaceURI, localName)

W3C DOM Level 2 Element method. Retrieves an attribute node by local name and namespace URI. An Element also has all the properties and methods of Node.

Table A-15 Parameters for the getAttributeNodeNS Method

Parameter

Description

namespaceURI

Specifies the namespaceURI of the attribute to retrieve.

localName

Specifies the name of the attribute to retrieve.

Example:

Temp.XPath("A/B[0]").getAttributeNodeNS("someURI", "someAttr"

setAttributeNodeNS(newAttr)

Attr setAttributeNodeNS(newAttr)

W3C DOM Level 2 Element method. Adds a new attribute. If an attribute with the same local name and namespace URI is already present in the element, it is replaced by the new attribute. If the newAttr attribute replaces an existing attribute with the same local name and namespace URI, the replaced Attr node is returned, otherwise null is returned. The newAttr parameter is a new attribute object. An Element also has all the properties and methods of Node.

Example:

Temp.XPath("A/B[0]").setAttributeNodeNS(newAttr)

getElementsByTagNameNS(namespaceURI, localName)

NodeList getElementsByTagNameNS(namespaceURI, localName)

W3C DOM Level 2 Element method. Returns a NodeList of all the descendant Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of this Element tree. An Element also has all the properties and methods of Node.

Table A-16 Parameters for the getElementsByTagNameNS Method

Parameter

Description

namespaceURI

Specifies the namespaceURI of the elements on which to match. The special value “*” matches all namespaces.

localName

Specifies the localName of the elements on which to match. The special value “*” matches all local names.

Example:

Temp.XPath("A/B[0]").getElementsByTagNameNS("someURI", "someName")

hasAttribute(name)

boolean hasAttribute()

W3C DOM Level 2 Element method. Returns True when an attribute with a given name is specified for this element or has a default value. Otherwise, returns False. The parameter name is a string that specifies the attribute name for which to look. An Element also has all the properties and methods of Node.

Example:

Temp.XPath("A/B[0]").hasAttribute("someName")

hasAttributeNS(namespaceURI, localName)

boolean hasAttributeNS(namespaceURI, localName)

W3C DOM Level 2 Element method. Returns True when an attribute with a given local name and namespace URI is specified on this element or has a default value. Otherwise, returns False. An Element also has all the properties and methods of Node.

Table A-17 Parameters for the hasAttributeNS Method

Parameter

Description

namespaceURI

Specifies the namespaceURI of the attribute for which to look.

localName

Specifies the localName of the attribute for which to look.

Example:

Temp.XPath("A/B[0]").hasAttributeNS("someURI", "someName")

A.3.4 Attribute

Lets you work with attributes.

name

W3C DOM Level 1 attribute property. This property returns a String object indicating the tag name of the attribute. An attribute also has all the properties and methods of Node.

specified

W3C DOM Level 1 Attr property. This property returns a Boolean. An attribute also has all the properties and methods of Node.

text

Designer extension property. This property returns the text value of the attribute.

value

W3C DOM Level 1 Attr property. This property returns a String object representing the text value of the attribute. An attribute also has all the properties and methods of Node.

setValue(Object aValue)

setValue(Object aValue)

Designer extension method. Sets the value of an attribute from the passed object.

toString()

String toString()

ECMAScript extension method. Gets the text node associated with the attribute.

ownerElement

W3C DOM Level 2 Attr property. Returns the Element node to which this attribute is attached. Returns null if this attribute is not in use. An Attr also has all the properties and methods of Node.

Example:

attributeObject.ownerElement

A.3.5 CharacterData

Lets you work with character data.

data

W3C DOM Level 1 CharacterData property. This property is of type String and represents the contents of the CharacterData object. CharacterData also has all the properties and methods of Node.

length

W3C DOM Level 1 CharacterData property. This property represents the length of the CharacterData object. CharacterData also has all the properties and methods of Node.

appendData(arg)

void appendData(arg)

W3C DOM Level 1 CharacterData method. Appends text to the CharacterData object. The arg parameter is of type String. CharacterData also has all the properties and methods of Node.

insertData(offset, arg)

void insertData(offset, arg)

W3C DOM Level 1 CharacterData method. Inserts text in the CharacterData object. The offset parameter is of type unsigned long. The arg parameter is of type String. CharacterData also has all the properties and methods of Node.

deleteData(offset, count)

void deleteData(offset, count)

W3C DOM Level 1 CharacterData method. Deletes text in the CharacterData object. The offset and count parameters are of type unsigned long. CharacterData also has all the properties and methods of Node.

replaceData(offset, count, arg)

void replaceData(offset, count, arg)

W3C DOM Level 1 CharacterData method. Replaces text in the CharacterData object. The offset and count parameters are of type unsigned long. The arg parameter is of type String. CharacterData also has all the properties and methods of Node.

substringData(offset, count)

String substringData(offset, count)

W3C DOM Level 1 CharacterData method. Returns a substring of the CharacterData object. The offset and count parameters are of type unsigned long. CharacterData also has all the properties and methods of Node.

A.3.6 NodeList

Lets you work with node lists.

length

W3C DOM Level 1 NodeList property. This property returns the number of nodes in a NodeList object.

avg('[NodeList]')

Number avg('[NodeList]')

ECMAScript aggregate extension method. Returns a number equal to the average value in the NodeList. The NodeList parameter is of type XPath. If no parameter is supplied, then the current NodeList/GroupName is used. The function argument should be in single quotes, and must be escaped for nested calls.

Example:

Input.XPath("rootElem/childElem").avg() 

count('[NodeList]')

Number count('[NodeList]')

ECMAScript aggregate extension method. Returns a number equal to a count of the nodes in the NodeList that have data. Nodes without data, or nodes with only child elements are not counted. To count all nodes, use the .length property on a nodeList object. The optional NodeList parameter is of type XPath. If no parameter is supplied (the usual case), then the current NodeList/GroupName is used. The function argument should be in single quotes, and must be escaped for nested calls.

Example:

Input.XPath("rootElem/childElem").count()

item(index)

Node item(index)

W3C DOM Level 1 NodeList method. Returns the indicated Node from the NodeList. The index parameter is of type unsigned long. The Index is 0-based.

min('[NodeList]')

Number min('[NodeList]')

ECMAScript aggregate extension method. Returns a number equal to the lowest value in the NodeList. The NodeList parameter is of type XPath. If no parameter is supplied, then the current NodeList/GroupName is used. The function argument should be in single quotes, and must be escaped for nested calls.

Example:

Input.XPath("rootElem/childElem").min() 

max(['NodeList]')

Number max('[NodeList]')

ECMAScript aggregate extension method. Returns a number equal to the highest value in the NodeList. The NodeList parameter of type XPath. If no parameter is supplied, then the current NodeList/GroupName is used. The function argument should be in single quotes, and must be escaped for nested calls.

Example:

Input.XPath("rootElem/childElem").max()

sum('[NodeList]')

Number sum('[NodeList]')

ECMAScript aggregate extension method. Returns a number equal to the sum of the values in NodeList. The NodeList parameter is of type XPath. If no parameter is supplied, then the current NodeList/GroupName is used. The function argument should be in single quotes, and must be escaped for nested calls.

Example:

Input.XPath("rootElem/childElem").sum() 

where(XPathType asPattern)

NodeList where(String asPattern)

ECMAScript extension method. Gets a NodeList of nodes matching the XPath pattern.

toNumber()

toNumber()

Converts the data of the first instance in the NodeList to an ECMAScript Number object. Any alphabetic characters or embedded spaces in data return NaN. Leading and trailing spaces are permitted.

Example:

var myNum = Input.XPath("Invoice/Amount").toNumber()

A.3.7 NamedNodeMap

Lets you work with named node maps.

length

length W3C DOM Level 1 NamedNodeMap property. This property returns the number of nodes in a NamedNodeMap.

getNamedItem(name)

Node getNamedItem(name)

W3C DOM Level 1 NamedNodeMap method. Returns all selected Nodes of the indicated name. The name parameter is of type String.

getNamedItemNS(namespaceURI, localName)

Node getNamedItemNS(namespaceURI, localName)

W3C DOM Level 2 NamedNodeMap method. Returns a node specified by local name and namespace URI.

Table A-18 Parameters for the NamedNodeMap Method

Parameter

Description

namespaceURI

Specifies the namespaceURI of the node to retrieve.

localName

Specifies the localName of the node to retrieve.

Example:

Temp.XPath("A/B").item(0).getAttributes() .getNamedItemNS("someURI", "anAttrName")

item(index)

Node item(index)

W3C DOM Level 1 NamedNodeMap method. Returns the indicated Node from the NamedNodeMap. The index parameter is of type unsigned long. The index is 0-based.

removeNamedItem(name)

Node removeNamedItem(name)

W3C DOM Level 1 NamedNodeMap method. Removes the indicated node from the NamedNodeMap and returns an unattached node. The name parameter is of type String.

removeNamedItemNS(namespaceURI, localName)

Node removeNamedItemNS(namespaceURI, localName)

W3C DOM Level 2 NamedNodeMap method. Removes and returns the node specified by namespace URI and local name.

Table A-19 Parameters for the removeNamedItemNS Method

Parameter

Description

namespaceURI

Specifies the namespaceURI of the node to remove.

localName

Specifies the localName of the node to remove.

Example:

Temp.XPath("A/B").item(0).getAttributes() .removeNamedItemNS("someURI", "anAttrName")

setNamedItem(arg)

Node setNamedItem(arg)

W3C DOM Level 1 NamedNodeMap method. Returns a Node. The arg parameter is of type Node.

setNamedItemNS(Node arg)

Node setNamedItemNS(arg)

W3C DOM Level 2 NamedNodeMap method. If the new Node replaces an existing node, the replaced Node is returned, otherwise null is returned.

Example:

var item = Temp.XPath("A/B").item(0);
item.getAttributes().setNamedItemNS(aNodeObject)

A.3.8 Text

Lets you work with text.

splitText(offset)

Text splitText(offset)

W3C DOM Level 1 Element method. Removes the text up to the offset and creates an unattached text node with the removed text. The offset parameter is of type unsigned long. A Text also has all the properties and methods of CharacterData.

A.3.9 DocumentType

Lets you work with document types.

name

W3C DOM Level 1 DocumentType property. This property returns a String representing the document type name.

entities

W3C DOM Level 1 DocumentType property. This property returns a NamedNodeMap of the entities defined in the document.

internalSubset

W3C DOM Level 2 DocumentType property. This property returns a String representing the internal subset as a string.

notations

W3C DOM Level 1 DocumentType property. This property returns a NamedNodeMap of the notations defined in the document.

publicId

W3C DOM Level 2 DocumentType property. This property returns a String representing the public identifier of the external subset.

systemId

W3C DOM Level 2 DocumentType property. This property returns a String representing the system identifier of the external subset.

A.3.10 DOMImplementation

Lets you work with DOM implementations.

createDocument(namespaceURI, qualifiedName, doctype)

Document createDocument(namespaceURI, qualifiedName, doctype)

W3C DOM Level 2 DOMImplementation method. Creates an XML Document object of the specified type with its document element.

Table A-20 Parameters for the DOMImplementation Method

Parameter

Description

namespaceURI

Specifies the namespaceURI of the document element to create.

qualifiedName

Specifies the qualified name of the document element to create. qualifiedName = namespaceprefix + : + localName

doctypei

Specifies the type of document to create, or null.

createDocumentType(qualifiedName, publicID, systemID)

DocumentType createDocumentType(qualifiedName, publicID, systemID)

W3C DOM Level 2 DOMImplementation method. Creates an empty DocumentType node. Parameters: qualifiedName is a string of the name of the document type to create. publicID is the external subset public identifier. systemID is the external subset system identifier. Note: qualifiedName = namespaceprefix + : + localName

Table A-21 Parameters for the createDocumentType Method

Parameter

Description

qualifiedName

Specifies the qualified name of the document element to create. qualifiedName = namespaceprefix + : + localName

publicID

Specifies the external subset public identifier.

systemID

Specifies the external subset system identifier.

hasFeature(feature, version)

boolean hasFeature(feature, version)

W3C DOM Level 1 DOMImplementation method. Returns a Boolean. The feature parameter is of type String. The version parameter is of type String.

A.3.11 Notation

Lets you work with notation.

publicId

W3C DOM Level 2 This property returns a String representing the public identifier of the external subset.

systemId

W3C DOM Level 2 property. This property returns a String representing the system identifier of the external subset.

A.3.12 Entity

Lets you work with entities.

publicId

W3C DOM Level 2 property. This property returns a String representing the public identifier of the external subset.

systemId

W3C DOM Level 2 property. This property returns a String representing the system identifier of the external subset.

notationName

W3C DOM Level 1 Entity property. This property is of type String. An Entity also has all the properties and methods of Node.

A.3.13 ProcessingInstruction

Lets you work with processing instructions.

target

W3C DOM Level 1 ProcessingInstruction property. This property is a String representation of the target part of a Processing Instruction.

data

W3C DOM Level 1 ProcessingInstruction property. This property is a String representation of the data part of a Processing Instruction.