This site has been taken over by the staff of www.ASPDeveloper.Net

Please report errors to suggest@aspdeveloper.net

BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
XML DOM
Want to use a treeview control with the DOM, or want to learn about the DOM
Beginners demo into working with the DOM object
Using the XML DOM and session variables
Programming the SAX2 interfaces from Visual Basic.
QuickParse (updated!)
MSXML Parser Sniffer
XML Directory Viewer
getDOMDocument
Get Search terms collection from an entered query string
MXSML based class module to perform Base64 encoding and decoding
Chilkat XML
Import and Export Microsoft Outlook items to XML using MSXML
A MsXML Wrapper class for VC++
Processing Large XML Documents
CSV to XML using the DOM
XML DOM: Inserting, Modifying and Deleting elements using VBScript
XML DOM: Adding an Child Element and an attribute using VBScript
Combining XML Documents using XSLT - a collection of 5 approaches
How to use InsertAfter() with XmlDocument?
How to remove xml elements using RemoveChild() with XmlDocument?
<< XHTML
XmlSerializer >>

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/19/2008
Times viewed :13583

 

XML DOM Reference

Play the DOM game

Learn by playing the "Understanding the XML DOM" game.  Read about the XML DOM and then answer the questions.  See if you can get a 100% score and if not, play it again.

Microsoft has shipped some very useful objects with IE that can be used from any programming language that can make use of COM objects. In this part of the book, we will focus on the XML DOM objects using VB or VBScript.

To better understand code or descriptions of the DOMDocument, try to think of an XML document as a tree. Another useful analogy is to think of parents and their children.

To better understand code or descriptions about the DOM, try to think of an XML document as a tree. Another useful analogy is to think of parents and their children. We start with the actual root of the document, then it meanders down to each processing instruction, the document root element, attributes, etc. These objects in the DOM are known by there own type (e.g., Element, Attribute, etc.), but each type is generally called a Node. The DOM gives us collections objects as well, known as NodeLists when a parent has many children that need to be grouped. Figure  describes how the tree structure is implemented:

This chapter, while comprehensive, should not be used as a complete reference.

The XML DOM Object implements the XML DOM interfaces. These interfaces make reusability throughout the DOM practical. Because these two objects share the same interfaces, the code becomes easier to understand and work with, which we will see in a short while.

Index by subject

CDATA section 1

- A -

abort() 1

ADO 1

appendChild 1

appendChild() 1

Asynchronously 1

attribute

adding an attribute 1, 2, 3

creating 1

getting an attribute 1, 2, 3

getting an element from the ID 1

removing 1, 2, 3

Attributes 1

- C -

CDATA section 1, 2, 3

childNodes 1

comment

creating 1

createAttribute() 1

createCDATASection() 1

createComment() 1

createElement() 1

createEntityReference() 1

createNode() 1

createProcessingInstruction() 1

createTextNode() 1

- D -

data 1

datatype 1, 2, 3

DOCTYPE 1, 2

Document Object Model 1

documentElement 1

DOM

DOM object methods 1

DOM object properties 1

DOMDocument 1

Dual interfaces 1

- E -

element

creating 1

getting an element 1

Entities 1, 2, 3

entity reference

creating 1

EntityReference 1

- F -

firstChild 1

- G -

getAttribute() 1

getAttributeNode() 1

getElementsByTagName() 1, 2

getNamedItem() 1

- H -

hasChildNodes() 1

- I -

IE5 1

insertBefore 1

insertBefore() 1

interfaces 1

- L -

lastChild 1

length 1

load 1

loadXML() 1

- N -

Namespaces 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11

namespaceURI 1

nextNode() 1

nextSibling 1

Node type enumeration 1

nodeFromID() 1

nodeName 1

nodeType 1

creating a Node 1

NODE_ATTRIBUTE 1

NODE_CDATA_SECTION 1

NODE_COMMENT 1

NODE_DOCUMENT 1

NODE_DOCUMENT_TYPE 1

NODE_ELEMENT 1

NODE_ENTITY 1

NODE_ENTITY_REFERENCE 1

NODE_NOTATION 1

NODE_PROCESSING_INSTRUCTION 1

NODE_TEXT 1

nodeTypedValue 1

nodeTypeString 1

nodeValue 1

Notation 1

- O -

ondataavailable 1

ontransformnode 1

open 1

ownerDocument 1

- P -

parentNode 1

parsed 1

parseError 1

prefix 1

preserveWhiteSpace 1

previousSibling 1

Processing Instruction 1

- R -

removeAttribute() 1

removeAttributeNode() 1

removeChild() 1

removeNamedItem() 1

replaceChild 1

replaceChild() 1

reset() 1

resolveExternals 1

- S -

save() 1

Schemas 1, 2, 3

selectNodes 1

selectNodes() 1

selectSingleNode 1

selectSingleNode() 1

send() 1

setAttribute() 1

setAttributeNode() 1

setNamedItem() 1

- T -

tagName 1

text 1

transformNode() 1

transformNodeToObject() 1

- U -

url 1

- V -

validateOnParse 1

value 1

- W -

whitespace 1

- X -

XML DOM Attribute 1, 2, 3, 4, 5

XML DOM CDATASection 1, 2, 3, 4

XML DOM Document

cloneNode() 1

XML DOM DocumentType 1, 2, 3

XML DOM Element 1, 2, 3, 4, 5, 6, 7, 8

XML DOM Entity 1, 2, 3, 4

XML DOM NamedNodeMap 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12

XML DOM Node 1, 2, 3, 4, 5, 6

XML DOM NodeList 1, 2, 3, 4, 5, 6, 7, 8, 9

XML DOM NodeListMap 1

XML DOM ParseError 1, 2, 3

XML DOM ProcessingInstruction 1, 2

XMLHTTPRequest 1, 2, 3

XSL

transforming XML to HTTP 1


This manuscript is an abridged version of a chapter from the Manning Publications book XML Programming with VB and ASP. This chapter looks at the Microsoft DOM objects. NOTE: Most images have been removed to increase speed and many of the code comments have also been removed for presentation. Please purchase the book to enjoy the full experience of all the chapters with images and code comments!


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

Software Specialist, Linux - Finlan
Linux Core Technical Project Manage
Graphics designer at Tanzania. Expe
Integration Specialist Needed - Wor
Virtualization Server Infrastructur

View all Jobs (Add yours)
View all CV (Add yours)






    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP