Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT
  Features
      Ask DevGuru
      ASP Resources
      HTML Color Chart
      Find the Bug
      Knowledge Base
      Links
      Tips of the Week
      T-SQL Syntax Charts
      Tutorials
  Products
      dgCalendar
      dgCharge
      dgChart
      dgEncrypt
      dgFileUpload
      dgReport
      dgSort
      dgTree
  Site
      Authoring
      Coming Soon
      DevGuru Resume
      Errata
      Link to Us
      Merchandise
      Sponsorships
      Testimonials
      What's New
  Partners
      Code Project
      DevelopersDex
      Prog. Heaven
      Tek-Tips Forum
      TopXML
      VBXML.COM
      VisualBuilder.com
      W3Schools
      XMLPitstop
      ZVON.org
      Search Us!

       











PROPERTY:  Object::nodeTypeString

This property is a Microsoft extension to the W3C DOM.

Object  Attr   CDATASection   CharacterData   Comment   Document   DocumentFragment   DocumentType   Entity   EntityReference   Node   Notation   ProcessingInstruction   Text
 
Object.nodeTypeString

The nodeTypeString property is read-only and returns the node type in string form.

In the following example the code uses the 'staff.xml' file.

XML:
<staff>
   <employee ssn="123456" pay="3">
      <name>John Sullivan</name>
      <position>&snrex;</position>
   </employee>
   <employee ssn="987654" pay="2">
      <name>Mary Lopez</name>
      <position>&pa;</position>
   </employee>
</staff>

The code then uses the nodeTypeString property to display the node type of the first child node of the root element (the 'employee' element), and the node type of that node's first attribute.

Code (JavaScript):
xml_doc = new ActiveXObject("Microsoft.XMLDOM");
xml_doc.async = false;
xml_doc.load("staff.xml");

node = xml_doc.documentElement.firstChild;
document.write(node.nodeTypeString);
atts = node.attributes;
document.write("<br>" + atts[0].nodeTypeString);

Output:
element
attribute





Copyright 1999-2002 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information