BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
XML DOM
The DOM Property: namespaceURI
The DOM Property: length
The DOM Property: documentElement
The DOM Property: docType
The DOM Property: data
The DOM Property: childNodes
The DOM Property: Attributes
The DOM Property: async
The DOM Property: DOM object properties
The DOM Method: transformNodeToObject()
The DOM Method: transformNode()
The DOM Method: setNamedItem()
The DOM Method: setAttributeNode()
The DOM Method: setAttribute()
The DOM Method: send()
The DOM Method: selectSingleNode()
The DOM Method: selectNodes()
The DOM Method: save()
The DOM Method: reset()
The DOM Method: replaceChild()
<< 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/24/2008
Times viewed :1657

 

nodeName

Is a member of:
DOMDocument
XMLDOMNode
XMLDOMAttribute
XMLDOMCDATASection
XMLDOMComment
XMLDOMDocumentFragment
XMLDOMDocumentType
XMLDOMElement
XMLDOMEntity
XMLDOMEntityReference
XMLDOMNotation
XMLDOMProcessingInstruction
XMLDOMText
XTLRuntime

Syntax

strValue = objDOMDocument.nodeName

Remark

This property is read-only. Depending on the type of Node, this property returns a string containing the Node's name. This is especially useful with elements and attributes. Table  details what is being represented by the nodeName property for the different interfaces of the DOMDocument.

0.0.1 Return values for the different XMLDOM interfaces (continued)

Interface name
Return value
XML DOM Element
The name of the element tag is returned, without the tag indi cators (</>).
XML Example: <EMAIL>markwilson@somewhere.com</ EMAIL>
Returns: EMAIL
When dealing with namespaces , the full tag name is returned.
XML Example: <resume:EMAIL>markwilson@some where.com</resume:EMAIL>
Returns: resume:EMAIL
XML DOM Attribute
The name of the element is returned.
XML Example: <PERSON PERSONID="p1">
Returns: PERSONID
XML DOM ProcessingIn struction
The target of the processing instruction is returned. This is the first word after the `<?' indicators.
XML Example: <?xml version="1.0" ?>
Returns: xml
XML DOM EntityReference
The name of the entity that is being references is returned, stripping off the entity reference indicators, namely the "&;".
XML Example: <ADDRESS>30 Animal Road, New York, &USA;</ADDRESS>
Returns: USA
XML DOM Entity
The name of the entity is returned.
XML Example: <!ENTITY USA "United States of America">
Returns: USA
XML DOM DocumentType
The name of the document type (DTD) is returned.
XML Example: <!DOCTYPE PEOPLE SYSTEM "http://localhost/xml code/people.dtd">
Returns: PEOPLE
XML DOM Notation
The name of the notation is returned.
XML Example: <img src="http://localhost/xmlcode/vbdev.gif">
Returns: img

The Node types listed in table  do not have nodeNames; therefore, they return the following string literals of what is being referenced.

0.0.1 Return values for XMLDOM interfaces with no nodeNames

Interface name
Return value
XML DOM Text
#text
XML DOM Comment
#comment
XML DOM CDATASection
#cdata-section
XML DOM Document
#document
XML DOM DocumentFragment
#document-fragment

Example

When we want to populate the textboxes on a VB form, we use the nodeName property to work with a Select Case as the decider of which text box should be populated.

In the following example, we have already obtained a reference to an element, which in this case is the PERSON element from our main XML example. We are now looping through its child Nodes, differentiating which Node is current by its nodeName property.

For Each objChildElement In objPersonElement.childNodes

If objChildElement.nodeType = NODE_ELEMENT Then

Select Case UCase(objChildElement.nodeName)

Case "NAME"

txtName.Text = objChildElement.nodeTypedValue

Case "ADDRESS"

txtAddress.Text = objChildElement.nodeTypedValue

Case "TEL"

txtTel.Text = objChildElement.nodeTypedValue

Case "FAX"

txtFax.Text = objChildElement.nodeTypedValue

Case "EMAIL"

txtEmail.Text = objChildElement.nodeTypedValue

End Select

End If

Next objChildElement


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

Integration Specialist Needed - Wor
Virtualization Server Infrastructur
A great opportunity to Digital Vide
here is a greate opportunity as a S
A great opportunity as a Network En

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



Information Online

swimming pool builder
chicago web site design
spfxmasks
Cheap Web Hosting
conference calling
Juicy couture sunglasses
answering service


    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