Skip to main content
XMLDocument property

Retrieves a reference to the XML Document Object Model (DOM) exposed by the object.



oXMLObject = object.XMLDocument


Property values

Type: Object

An Object that specifies a reference to the XML DOM exposed by the object.


XMLDocument is the default property; specifying the property is optional. The XMLDocument property is useful when an entire XML document is passed to a method that requires an IXMLDOMNode parameter, such as the transformNode method. The XML data island itself (denoted by the <xml> tag) is considered an html element, instead of an xml element. The XMLDocument property provides access to the root of the XML tree in the data island.

For a complete description of the XML DOM exposed by the XMLDocument property, see the XML DOM overview.


This example uses the XMLDocument property to access the object model of an xml data island.

<!DOCTYPE html>

  <meta http-equiv="X-UA-Compatible" content="IE=8" > <!-- XML islands are not supported in Internet Explorer 9 and later. -->
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>XML Islands</title>

  <xml id="metaData">
       <author>John Smith</author>
       <generator>Visual Notepad</generator>
       <abstract>Specifies an XML data island.</abstract>
  <button onclick="fnCheck();">Parse XML</button>
    function fnCheck(){
      var metaData = document.getElementById('metaData');
      if (!metaData.XMLDocument) {
          alert ("Your browser doesn't support the XMLDocument property.");
      var abstractNode = metaData.XMLDocument.selectSingleNode("metadata/abstract");
    } // fnCheck


See also

Introduction to Persistence