2 out of 6 rated this helpful - Rate this topic

XMLDocument property

[This documentation is preliminary and is subject to change.]

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

Syntax

JavaScript

oXMLObject = object.XMLDocument

Property values

Type: Object

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

Remarks

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.

Examples

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


<SCRIPT>
function fnCheck(){
   var oNode = oMetaData.XMLDocument.selectSingleNode
       ("METADATA/ABSTRACT");
   alert(oNode.text);
}
</SCRIPT>

<XML ID="oMetaData">
  <METADATA>
     <AUTHOR>John Smith</AUTHOR>
     <GENERATOR>Visual Notepad</GENERATOR>
     <PAGETYPE>Reference</PAGETYPE>
     <ABSTRACT>Specifies a data island</ABSTRACT>
  </METADATA>
</XML>

<INPUT TYPE=button VALUE="Test" onclick="fnCheck()">

See also

xml
Reference
XSLDocument
Conceptual
Introduction to Persistence

 

 

Build date: 2/14/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Also applies to SCRIPT
If SCRIPT type is "text/xml" and the source exists, the SCRIPT element creates the property after loading.
If the XML document is loaded into a frame and the frame fails to display its content for whatever reason (e.g. because the default style sheet is inaccessible), the property is not set and the source document is inaccessible too because the document content is replaced with an error message.