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::xml

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.xml

The xml property is read-only and contains the XML representation of this node and its descendants. This value for three of the node types, however, is slightly different depending on the nodeValue property. These nodes are:

  • NODE_DOCUMENT_FRAGMENT
    Returns a string representation of all the descendants of the document fragment.
  • NODE_DOCUMENT_TYPE
    Returns a string representation of the <!DOCTYPE ... > declaration, including the internal subset, if specified.
  • NODE_ENTITY_REFERENCE
    Returns a string representation of the entity reference, but not of its children.

In the following example, the code loads the 'albums.xml' file, and gets the xml property of the last 'Album' element and displays it.

XML:
<Albums>
   <Album ref="CD720">
      <category>Pop</category>
      <title>Come On Over</title>
      <artist>Shania Twain</artist>
   </Album>
   <Album ref="CD024">
      <category>&cw;</category>
      <title>Red Dirt Girl</title>
      <artist>Emmylou Harris</artist>
   </Album>
</Albums>

Code (VBScript):
Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = True
objXMLDoc.load("albums.xml")

Set Album = objXMLDoc.documentElement.lastChild
document.write(Album.xml)

Output:
&cw;
Red Dirt Girl
Emmylou Harris





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