Click to return to the DHTML, HTML     
window Object     XMP Element | XMP Object     DHTML Objects    
Web Workshop  |  DHTML, HTML & CSS

XML Element | XML Object


Defines an XML data island on an HTML page.

HTML Syntax

<XML
   ID = value
   NS = sNamespace
   PREFIX = sPrefix
   SRC = sUrl
   event  = script
></XML>

Remarks

The readyState property of the XML element, available as a string value, corresponds to the readyState property of the XMLDOMDocument object, which is available as a long value. The string values correspond to the long values of the XML document object's property as follows:

0uninitialized
1loading
2loaded
3interactive
4complete

Consider the following XML data island:

<XML ID=xmldoc SRC="123.xml"></XML>

Use the following two methods to check the value of the readyState property to determine whether the XML data island is completely downloaded.

The XML element requires a closing tag.

This element is available in HTML and script as of Microsoft® Internet Explorer 5.

Members

Styles

Example

This example uses the XML element to define a simple XML data island that can be embedded directly into an HTML page.

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

This script example retrieves the text contained within the ABSTRACT field of the data island.

   var oNode = oMetaData.XMLDocument.selectSingleNode("METADATA/ABSTRACT");
   alert(oNode.text);


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.