The W3C DOM

The W3C DOM specifies a way of treating a document as a tree of nodes. In this model, every discrete data item is a node, and child elements or enclosed text become subnodes. Treating a document as a tree of nodes is one good way of handling XML documents (although there are others, as we'll see when we start working with Java) because it makes it relatively easy to explicitly state which elements contain which other elements; the contained elements become subnodes of the container nodes. Everything in a document becomes a node in this model—elements, element attributes, text, and so on. Here are the possible node types in the W3C DOM:

  • Element

  • Attribute

  • Text

  • CDATA section

  • Entity reference

  • Entity

  • Processing instruction

  • Comment

  • Document

  • Document type

  • Document fragment

  • Notation

For example, take a look at this document:

<?xml version="1.0" encoding="UTF-8"?>
<DOCUMENT>
    <GREETING>
        Hello From XML
    </GREETING>
    <MESSAGE>
        Welcome to the wild and woolly world of XML.
    </MESSAGE>
</DOCUMENT>

This document has a processing instruction node and a root element node corresponding to the <DOCUMENT> element. The <DOCUMENT> node has two sub-nodes, the <GREETING> and <MESSAGE> nodes. These nodes are child nodes of the <DOCUMENT> node and sibling nodes of each other. Both the <GREETING> and <MESSAGE> elements have one subnode—a text node that holds character data. We'll get used to handling documents like this one as a tree of nodes in this chapter. Figure 7.1 shows what this document looks like.

Figure 7.1. Viewing the document as a tree.


Every discrete data item is itself treated as a node. Using the methods defined in the W3C DOM, you can navigate along the various branches of a document's tree using methods such as nextChild to move to the nextChild node, or lastSibling to move to the last sibling node of the current node. Working with a document this way takes a little practice, and that's what this chapter is all about.

There are a number of different levels of DOM:

  • Level 0. There is no official DOM "level 0," but that's the way W3C refers to the DOM as implemented in relatively early versions of the popular browsers—in particular, Netscape Navigator 3.0 and Microsoft Internet Explorer 3.0.

  • Level 1. This level of the DOM is the current W3C recommendation, and it concentrates on the HTML and XML document models. You can find the documentation for this level at http://www.w3.org/TR/REC-DOM-Level-1/.

  • Level 2. Currently at the Candidate Recommendation stage, this level of the DOM is more advanced and includes a style sheet object model. It also adds functionality for manipulating the style information attached to a document. In addition, it enables you to traverse a document, has a built-in event model, and supports XML namespaces. You can find the documentation for this level at http://www.w3.org/TR/DOM-Level-2/.

  • Level 3. This level is still in the planning stage and will address document loading and saving, as well as content models (such as DTDs and schemas) with document validation support. In addition, it will also address document views and formatting, key events, and event groups. There is no documentation on this level yet.

Practically speaking, the only nearly complete implementation of the XML DOM today is that in Internet Explorer version 5 or later. You can find the documentation for the Microsoft DOM at http://msdn.microsoft.com/library/psdk/xmlsdk/xmld20ab.htm as of this writing. However, the Microsoft sites are continually (and annoyingly) being reorganized, so it's quite possible that by the time you read this, that page will be long gone. In that case, your best bet is to go to http://msdn.microsoft.com and search for "xml dom." (The general rule is not to trust an URL at a Microsoft site for more than about two months.)

Because Internet Explorer provides substantial support for the W3C DOM level 1, I'm going to use it in this chapter. Let's hope that the translation to other W3C-compliant browsers, as those browsers begin to support the W3C DOM, won't be terribly difficult.

The XML DOM Objects

Here are the official W3C DOM level 1 objects:

ObjectDescription
DocumentThe document object.
DocumentFragmentReference to a fragment of a document.
DocumentTypeReference to the <!DOCTYPE> element.
EntityReferenceReference to an entity.
ElementAn element.
AttrAn attribute.
ProcessingInstructionA processing instruction.
CommentContent of an XML comment.
TextText content of an element or attribute.
CDATAsectionCDATA section
EntityIndication of a parsed or unparsed entity in the XML document.
NotationHolder for a notation.
NodeA single node in the document tree.
NodeListA list of node objects. This allows iteration and indexed access operations.
NamedNodeMapAllows iteration and access by name to the collection of attributes.

Microsoft uses different names for these objects and adds its own. In particular, Microsoft defines a set of "base objects" that form the foundation of its XML DOM. The top-level object is the DOMDocument object, and it's the only one that you create directly—you reach the other objects through that object. Here's the list of base objects in Internet Explorer. Note the objects designed to treat a document as a tree of nodes—XMLDOMNode, XMLDOMNodeList, and so on:

ObjectDescription
DOMDocumentThe top node of the XML DOM tree.
XMLDOMNodeA single node in the document tree. It includes support for data types, namespaces, DTDs, and XML schemas.
XMLDOMNodeListA list of node objects. It allows iteration and indexed access operations.
XMLDOMNamedNodeMapAllows iteration and access by name to the collection of attributes.
XMLDOMParseErrorInformation about the most recent error. It includes error number, line number, character position, and a text description.
XMLHttpRequestAllows communication with HTTP servers.
XTLRuntimeSupports methods that you can call from XSL style sheets.

Besides these base objects, the Microsoft XML DOM also provides these XML DOM objects that you use when working with documents in code, including the various types of nodes, which you see supported with objects of types such as XMLDOMAttribute, XMLDOMCharacterData, and XMLDOMElement:

ObjectDescription
XMLDOMAttributeStands for an attribute object.
XMLDOMCDATASectionHandles CDATA sections so that text is not interpreted as markup language.
XMLDOMCharacterDataProvides methods used for text manipulation.
XMLDOMCommentGives the content of an XML comment.
XMLDOMDocumentFragmentIs a lightweight object useful for tree insert operations.
XMLDOMDocumentTypeHolds information connected to the document type declaration.
XMLDOMElementStands for the element object.
XMLDOMEntityStands for a parsed or unparsed entity in the XML document.
XMLDOMEntityReferenceStands for an entity reference node.
XMLDOMImplementationSupports general DOM methods.
XMLDOMNotationHolds a notation (as declared in the DTD or schema).
XMLDOMProcessingInstructionIs a processing instruction.
XMLDOMTextIs text content of an element or attribute.

We'll put many of these objects to work in this chapter, seeing how to parse and access XML documents using the Microsoft XML DOM and handling events as documents are loaded. We'll also see how to alter an XML document at run time.

This previous list of objects is pretty substantial, and each object can contain its own properties, methods, and events. Although most of these properties, methods, and events are specified in the W3C XML DOM, many are added by Microsoft as well (and so are nonstandard). If we're going to work with the XML DOM in practice, it's essential to have a good understanding of these objects, both practically for the purposes of this chapter and also for reference. I'll go through the major objects in some detail to make handling the XML DOM clear, starting with the main object, the DOMDocument object.

The DOMDocument Object

The DOMDocument object is the main object that you work with, and it represents the top node in every document tree. When working with the DOM, this is the only object that you create directly.

As we'll see in this chapter, there are two ways to create document objects in Internet Explorer: using the Microsoft.XMLDOM class and using XML data islands. Creating a document object with the Microsoft.XMLDOM class looks like this, where you explicitly load a document into the object with the load method:

function readXMLDocument()
{
    var xmldoc
    xmldoc = new ActiveXObject("Microsoft.XMLDOM")
    xmldoc.load("meetings.xml")
    .
    .
    .

We'll also see that you can use the <XML> HTML element to create a data island in Internet Explorer, and then use the XMLDocument property of that element to gain access to the corresponding document object:

<XML ID="meetingsXML" SRC="meetings.xml"></XML>

<SCRIPT LANGUAGE="JavaScript">
    function readXMLDocument()
    {
         xmldoc = document.all("meetingsXML").XMLDocument
         .
         .
         .

XML DOM and Multithreaded Programs

There's also a "free-threaded" version of the Microsoft.XMLDOM class that you can use in multithreaded programs:

var xmldoc = new ActiveXObject("Microsoft.FreeThreadedXMLDOM")

For more information on this advanced topic, take a look at the Microsoft XML DOM site (at http://msdn.microsoft.com/library/psdk/xmlsdk/xmld20ab.htm as of this writing, but very probably moved by the time you read this).


Here are the properties of this object:

PropertyDescription
async[*]Indicates whether asynchronous download is allowed. Read/write.
attributesHolds the list of attributes for this node. Read-only.
baseName[*]Is the base name qualified with the namespace. Read-only.
childNodesHolds a node list containing child nodes for nodes that may have children. Read-only.
dataType[*]Gives the data type for this node. Read/write.
definition[*]Gives the definition of the node in the DTD or schema. Read-only.
doctypeSpecifies the document type node, which is what specifies the DTD for this document. Read-only.
documentElementGives the root element of the document. Read/write.
firstChildGives the first child of the current node. Read-only.
implementationSpecifies the XMLDOMImplementation object for this document. Read-only.
lastChildGives the last child node of the current node. Read-only.
namespaceURI[*]Gives the URI for the namespace. Read-only.
nextSiblingSpecifies the next sibling of the current node. Read-only.
nodeNameSpecifies the qualified name of the element, attribute, or entity reference. Holds a fixed string for other node types. Read-only.
nodeTypeGives the XML DOM node type. Read-only.
nodeTypedValue[*]Holds this node's value. Read/write.
nodeTypeString[*]Gives the node type expressed as a string. Read-only.
nodeValueIs the text associated with the node. Read/write.
ondataavailable[*]Is the event handler for the ondataavailable event. Read/write.
onreadystatechange[*]Is the event handler that handles readyState property changes. Read/write.
ontransformnode[*]Is the event handler for the ontransformnode event. Read/write.
ownerDocumentGives the root of the document that contains this node. Read-only.
parentNodeSpecifies the parent node (for nodes that can have parents). Read-only.
parsed[*]Is true if this node and all descendants have been parsed; is false otherwise. Read-only.
parseError[*]Is an XMLDOMParseError object with information about the most recent parsing error. Read-only.
prefix[*]Gives the namespace prefix. Read-only.
preserveWhiteSpace[*]Is true if processing should preserve whitespace; is false otherwise. Read/write.
previousSiblingSpecifies the previous sibling of this node. Read-only.
readyState[*]Gives the current state of the XML document. Read-only.
resolveExternals[*]Indicates whether external definitions are to be resolved at parse time. Read/write.
specified[*]Indicates whether the node is explicitly given or derived from a default value. Read-only.
text[*]Gives the text content of the node and its subtrees. Read/write.
url[*]Specifies the canonical URL for the most recently loaded XML document. Read-only.
validateOnParse[*]Indicates whether the parser should validate this document. Read/write.
xml[*]Gives the XML representation of the node and all its descendants. Read-only.

[*] Microsoft extension to the W3C DOM.

Here are the methods of the document object:

MethodDescription
abort[*]Aborts an asynchronous download
appendChildAppends a new child as the last child of the current node
cloneNodeReturns a new node that is a copy of this node
createAttributeReturns a new attribute with the given name
createCDATASectionReturns a CDATA section node that contains the given data
createCommentReturns a comment node
createDocumentFragmentReturns an empty DocumentFragment object
createElementReturns an element node using the given name
createEntityReferenceReturns a new EntityReference object
createNode[*]Returns a node using the given type, name, and namespace
createProcessingInstructionReturns a processing instruction node
createTextNodeReturns a text node that contains the given data
getElementsByTagNameYields a collection of elements that have the given name
hasChildNodesIs true if this node has children
insertBeforeInserts a child node before the given node
load[*]Loads an XML document from the given location
loadXML[*]Loads an XML document using the given string
nodeFromID[*]Yields the node whose ID attribute matches the given value
removeChildRemoves the given child node from the list of children
replaceChildReplaces the given child node with the given new child node
save[*]Saves an XML document to the given location
selectNodes[*]Applies the given pattern-matching operation to this node's context, returning a list of matching nodes
selectSingleNode[*]Applies the given pattern-matching operation to this node's context, returning the first matching node
transformNode[*]Transforms this node and its children using the given XSL style sheet
transformNodeToObject[*]Transforms this node and its children to an object, using the given XSL style sheet

Here are the events of the document object:

EventDescription
ondataavailable[*]Indicates that XML document data is available
onreadystatechange[*]Indicates when the readyState property changes
ontransformnode[*]Happens before each node in the style sheet is applied in the XML source

The XMLDOMNode Object

The Microsoft XMLDOMNode object extends the core XML DOM node interface by adding support for data types, namespaces, DTDs, and schemas as implemented in Internet Explorer. We'll use this object a good deal as we traverse document trees. Here are the properties of this object:

PropertyDescription
attributesThe list of attributes for this node. Read-only.
baseName[*]The base name for the name qualified with the namespace. Read-only.
childNodesA node list containing the child nodes of the current node. Read-only.
dataType[*]The data type for this node. Read/write.
definition[*]The definition of the node in the DTD or schema. Read-only.
firstChildThe first child of the current node. Read-only.
lastChildThe last child of the current node. Read-only.
namespaceURI[*]The URI for the namespace. Read-only.
nextSiblingThe next sibling of this node. Read-only.
nodeNameHolder for a qualified name for an element, attribute, or entity reference, or a string for other node types. Read-only.
nodeTypeThe XML DOM node type. Read-only.
nodeTypedValue[*]The node's value. Read/write.
nodeTypeString[*]The node type in string form. Read-only.
nodeValueThe text associated with the node. Read/write.
ownerDocumentThe root of the document. Read-only.
parentNodeThe parent node. Read-only.
parsed[*]True if this node and all descendants have been parsed; false otherwise. Read-only.
prefix[*]The namespace prefix. Read-only.
previousSiblingThe previous sibling of this node. Read-
specified[*]Indication of whether a node is explicitly given or derived from a default value. Read-only.
text[*]The text content of the node and its subtrees. Read/write.
xml[*]The XML representation of the node and all its descendants. Read-only.

Here are the methods of this object:

MethodDescription
appendChildAppends a new child as the last child of this node
cloneNodeCreates a new node that is a copy of this node
hasChildNodesIs true if this node has children
insertBeforeInserts a child node before the given node
removeChildRemoves the given child node
replaceChildReplaces the given child node with the given new child node
selectNodes[*]Applies the given pattern-matching operation to this node's context, returning a list of matching nodes
selectSingleNode[*]Applies the given pattern-matching operation to this node's context, returning the first matching node
transformNode[*]Transforms this node and its children using the given XSL style sheet
transformNodeToObject[*]Transforms this node and its children using the given XSL style sheet, returning the result in an object

This object has no events.

The XMLDOMNodeList Object

You use the XMLDOMNodeList to handle lists of nodes. Node lists are useful because a node itself can have many child nodes. Using a node list, you can handle all the children of a node at once.

For example, here I'm loading a document and getting a list of all <PERSON> elements as a node list, using the document object's getElementsByTagName method:

function readXMLDocument()
{
    var xmldoc, nodeList
    xmldoc = new ActiveXObject("Microsoft.XMLDOM")
    xmldoc.load("meetings.xml")
    nodeList = xmlDoc.getElementsByTagName("PERSON")
    .
    .
    .

The XMLDOMNodeList object has a single property, length, which describes the number of items in the collection and is read-only.

Here are the methods of the XMLDOMNodeList object:

MethodDescription
itemAllows random access to nodes in the collection
nextNode[*]Indicates the next node in the collection
reset[*]Resets the list iterator

This object has no events.

The XMLDOMNamedNodeMap Object

The Microsoft XML DOM also supports an XMLDOMNamedNodeMap object, which provides support for namespaces. Here are the properties of this object:

PropertyDescription
lengthGives the number of items in the collection. Read-only.
itemAllows random access to nodes in the collection. Read-only.

Here are the methods of this object:

MethodDescription
getNamedItemGets the attribute with the given name
getQualifiedItem[*]Gets the attribute with the given namespace and attribute name
nextNodeGets the next node
removeNamedItemRemoves an attribute
removeQualifiedItemRemoves the attribute with the given namespace and attribute name
resetResets the list iterator
setNamedItemAdds the given node

This object has no events.

The XMLDOMParseError Object

The Microsoft XMLDOMParseError object holds information about the most recent parse error, including the error number, line number, character position, and a text description. Although it's not obvious to anyone who loads an XML document into Internet Explorer, the browser does actually validate the document using either a DTD or schema if one is supplied. It's not obvious that this happens because, by default, Internet Explorer does not display any validation error messages. However, if you use the XMLDOMParseError object, you can get a full validation report, and I'll do so later in this chapter.

Here are the properties of this object:

PropertyDescription
errorCodeThe error code of the most recent parse error. Read-only.
fileposThe file position where the error occurred. Read-only.
lineThe line number that contains the error. Read-only.
lineposThe character position in the line where the error happened. Read-only.
reasonThe reason for the error. Read-only.
srcTextThe full text of the line containing the error. Read-only.
urlThe URL of the XML document containing the last error. Read-only.

Note that this object does not have any methods or events, and it does not correspond to any official W3C object in the W3C DOM.

The XMLDOMAttribute Object

In both the W3C and Microsoft DOM, attribute objects are node objects (that is, they are based on the node object), but they are not actually child nodes of an element and are not considered part of the document tree. Instead, attributes are considered properties of their associated elements. (This means that properties such as parentNode, previousSibling, or nextSibling are meaningless for attributes.) We'll see how to work with attributes in this chapter.

Here are the properties of the XMLDOMAttribute object:

PropertyDescription
attributesThe list of attributes for this node. Read-only.
baseName[*]The base name for the name qualified with the namespace. Read-only.
childNodesA node list containing child nodes. Read-only.
dataType[*]The data type of this node. Read/write.
definition[*]The definition of the node in the DTD or schema. Read-only.
firstChildThe first child of the current node. Read-only.
lastChildThe last child of the current node. Read-only.
nameThe attribute name. Read-only.
namespaceURI[*]The URI for the namespace. Read-only.
nextSiblingThe next sibling of this node. Read-only.
nodeNameThe qualified name for an element, attribute, or entity reference, or a string for other node types. Read-only.
nodeTypeThe XML DOM node type. Read-only.
nodeTypedValue[*]The node's value. Read/write.
nodeTypeString[*]The node type in string form. Read-only.
nodeValueThe text associated with the node. Read/write.
ownerDocumentThe root of the document. Read-only.
parentNodeHolder for the parent node (for nodes that can have parents). Read-only.
parsed[*]True if this node and all descendants have been parsed; false otherwise. Read-only.
prefix[*]The namespace prefix. Read-only.
previousSiblingThe previous sibling of this node. Read-only.
specifiedIndication of whether the node (usually an attribute) is explicitly specified or derived from a default value. Read-only.
textThe text content of the node and its subtrees. Read/write.
valueThe attribute's value. Read/write.
xmlThe XML representation of the node and all its descendants. Read-only.

Here are the methods of the XMLDOMAttribute object:

MethodDescription
appendChildAppends a new child as the last child of this node
cloneNodeReturns a new node that is a copy of this node
hasChildNodesIs true if this node has children
insertBeforeInserts a child node before the given node
removeChildRemoves the given child node from the list
replaceChildReplaces the given child node with the given new child node
selectNodesApplies the given pattern-matching operation to this node's context, returning a list of matching nodes
selectSingleNodeApplies the given pattern-matching operation to this node's context, returning the first matching node
transformNodeTransforms this node and its children using the given XSL style sheet
transformNodeToObjectTransforms this node and its children using the given XSL style sheet, and returns the result in an object

This object does not support any events.

The XMLDOMElement Object

XMLDOMElement objects represent elements and are probably the most common node objects that you'll deal with. Because attributes are not considered child nodes of an element object, you use special methods to get the attributes of an element—for example, you can use the getAttribute method, which returns an XMLDOMNamedNodeMap object that contains all the element's attributes.

Here are the properties of the XMLDOMElement object:

PropertyDescription
attributesThe list of attributes for this node. Read-only.
baseName[*]The base name for the name qualified with the namespace. Read-only.
childNodesA node list containing the children. Read-only.
dataType[*]The data type for this node. Read/write.
definition[*]The definition of the node in the DTD or schema.
firstChildThe first child of this node. Read-only.
lastChildThe last child node of this node. Read-only.
namespaceURI[*]The URI for the namespace. Read-only.
nextSiblingThe next sibling of this node. Read-only.
nodeNameHolder for the qualified name of an element, attribute, or entity reference, or a string for other node types. Read-only.
nodeTypeIndication of the XML DOM node type. Read-only.
nodeTypeString[*]The node type in string form. Read-only.
nodeValueThe text associated with the node. Read/write.
ownerDocumentThe root of the document. Read-only.
parentNodeThe parent node of the current node. Read-only.
parsed[*]True if this node and all descendants have been parsed; false otherwise. Read-only.
prefix[*]The namespace prefix. Read-only.
previousSiblingThe previous sibling of this node. Read-only.
specified[*]Indication of whether the node is explicitly specified or derived from a default value in the DTD or schema. Read-only.
tagNameHolder for the element name. Read-only.
text[*]Holder for the text content of the node and its subtrees. Read/write.
xml[*]Holder for the XML representation of the node and all its descendants. Read-only.

Here are the methods of the XMLDOMElement object:

MethodDescription
appendChildAppends a new child as the last child of the current node
cloneNodeReturns a new node that is a copy of this node
getAttributeGets the value of the named attribute
getAttributeNodeGets the named attribute node
getElementsByTagNameReturns a list of all descendant elements that match the given name
hasChildNodesIs true if this node has children
insertBeforeInserts a child node before the given node
normalizeNormalizes all descendent elements, combining two or more text nodes next to each other into one text node
removeAttributeRemoves or replaces the named attribute
removeAttributeNodeRemoves the given attribute from this element
removeChildRemoves the given child node
replaceChildReplaces the given child node with the given new child node
selectNodes[*]Applies the given pattern-matching operation to this node's context, returning the list of matching nodes
selectSingleNode[*]Applies the given pattern-matching operation to this node's context, returning the first matching node
setAttributeSets the value of a named attribute
setAttributeNodeAdds or changes the given attribute node on this element
transformNode[*]Transforms this node and its children using the given XSL style sheet
transformNodeToObject[*]Transforms this node and its children using the given XSL style sheet, and returns the resulting transformation as an object

This object has no events.

The XMLDOMText Object

The XMLDOMText object holds the text content of an element or attribute. If there is no markup inside an element, but there is text, that element will contain only one node—a text node that holds the text. (In mixed-content models, text nodes can have sibling element nodes.)

When a document is first made available to the XML DOM, all text is normalized, which means that there is only one text node for each block of text. You can actually create text nodes that are adjacent to each other, although they will not be saved as distinct the next time that the document is opened. (It's worth noting that the normalize method on the XMLDOMElement object merges adjacent text nodes into a single node.)

Here are the properties of the XMLDOMText object:

PropertyDescription
attributesHolder for the list of attributes for this node. Read-only.
baseName[*]The base name for the name qualified with the namespace. Read-only.
childNodesA node list containing the child nodes. Read-only.
dataThis node's data (what's actually stored depends on the node type). Read/write.
dataType[*]The data type for this node. Read/write.
definition[*]The definition of the node in the DTD or schema. Read-only.
firstChildThe first child of the current node. Read-only.
lastChildThe last child of the current node. Read-only.
lengthThe length, in characters, of the data. Read-only.
namespaceURI[*]The URI for the namespace. Read-only.
nextSiblingThe next sibling of this node. Read-only.
nodeNameThe qualified name of an element, attribute, or entity reference, or a string for other node types. Read-only.
nodeTypeIndication of the XML DOM node type. Read-only.
nodeTypedValue[*]This node's value. Read/write.
nodeTypeString[*]The node type in string form. Read-only.
nodeValueThe text associated with the node. Read/write.
ownerDocumentThe root of the document. Read-only.
parentNodeThe parent node. Read-only.
parsed[*]True if this node and all descendants have been parsed; false otherwise. Read-only.
prefix[*]The namespace prefix. Read-only.
previousSiblingThe previous sibling of this node. Read-only.
specifiedIndication of whether the node is explicitly specified or derived from a default value. Read-only.
text[*]Holder for the text content of the node and its subtrees. Read/write.
xml[*]Holder for the XML representation of the node and all its descendants. Read-only.

Here are the methods of the XMLDOMText object:

MethodDescription
appendChildAppends a new child as the last child of this node
appendDataAppends the given string to the existing string data
cloneNodeReturns a new node that is a copy of this node
deleteDataRemoves the given substring within the string data
hasChildNodesIs true if this node has children
insertBeforeInserts a child node before the specified node
insertDataInserts the supplied string at the specified offset
removeChildRemoves the specified child node from the list of children
replaceChildReplaces the specified child node with the given new child node
selectNodes[*]Replaces the given number of characters with the given string
selectSingleNode[*]Applies the given pattern-matching operation to this node's context, returning a list of matching nodes
specified[*]Applies the specified pattern-matching operation to this node's context, returning an object
splitTextBreaks this text node into two text nodes
substringDataReturns a substring of the full string
transformNode[*]Transforms this node and its children using the given XSL style sheet
transformNodeToObject[*]Transforms this node and its children using the given XSL style sheet, and returns the resulting transformation as an object

This object doesn't support any events.

That gives us an overview of the most commonly used objects in the Microsoft XML DOM. Now I'm going to put them to work in the rest of the chapter. I'll start at the beginning—loading an XML document.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.197.164