XML object (Object/JScript)

An object that represents a block of XML page content within an HTML document.

Availability:

JScript - 5.0
Internet Explorer - 5.0
Inherits from:Element object
JavaScript syntax:IEmyXML = myDocument.all.anElementID
IEmyXML = myDocument.all.tags("XML")[anIndex]
IEmyXML = myDocument.all[aName]
-myXML = myDocument.getElementById(anElementID)
-myXML = myDocument.getElementsByName(aName)[anIndex]
-myXML = myDocument.getElementsByTagName("XML")[anIndex]
Argument list:anIndexA reference to an element in a collection
aNameAn associative array reference
anElementIDThe ID value of an Element object
Object properties:canHaveHTML, defer, event, htmlFor, src, text, type
Event handlers:onDataAvailable, onDatasetChanged, onDatasetComplete, onReadyStateChange, onRowEnter, onRowExit, onRowsDelete, onRowsInserted

The MSIE browser can now cope with pages delivered as arbitrary blocks of XML. If it encounters an <XML> tag, then it will instantiate one of these objects to provide JavaScript binding to it. This can also be used to build a small island of XML based content in the middle of an HTML page.

The XML data can sit in an HTML page like this:

   <XML ID="myBlock">
   <METADATA>
   <OWNER>Wrox</OWNER>
   <DATATYPE>Example</DATATYPE>
   <ABSTRACT>This is an example block of text</ABSTRACT>
   </METADATA>
   </XML>

Accessing the text property of the XML object will return all the inner text inside it. To access the components you will need to access the XMLDocument property to expose a DOM document interface. This can be explored using DOM compatible methods and properties.

See also:Document.readyState, onRowEnter, onRowExit

PropertyJavaScriptJScriptNavIEOperaNESECMADOMCSSHTMLNotes
canHaveHTML n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a n/a-
defer n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a n/a-
event n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a n/a-
htmlFor n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a n/a-
src n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a n/a-
text n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a n/a-
type n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a n/a-

Event nameJavaScriptJScriptNavIEOperaNESECMADOMCSSHTMLNotes
onDataAvailable n/a3.0 3.0 n/a4.0 4.0 n/a n/a n/a n/a n/a n/a-
onDatasetChanged n/a3.0 3.0 n/a4.0 4.0 n/a n/a n/a n/a n/a n/a-
onDatasetComplete n/a3.0 3.0 n/a4.0 4.0 n/a n/a n/a n/a n/a n/a-
onReadyStateChange n/a3.0 3.0 n/a4.0 4.0 n/a n/a n/a n/a n/a n/a-
onRowEnter n/a3.0 3.0 n/a4.0 4.0 n/a n/a n/a n/a n/a n/a-
onRowExit n/a3.0 3.0 n/a4.0 4.0 n/a n/a n/a n/a n/a n/a-
onRowsDelete n/a3.0 3.0 n/a4.0 4.0 n/a n/a n/a n/a n/a n/a-
onRowsInserted n/a3.0 3.0 n/a4.0 4.0 n/a n/a n/a n/a n/a n/a-

Inheritance chain:

Element object, Node object

Web-references:

http://msdn.microsoft.com/xml/xmlguide/dom-guide-document.asp