XML Element | XML Object

MS Office DHTML, HTML & CSS

XML Element | XML Object


Defines an xml data islandInternet Link 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 readystateInternet Link property of the xmldomdocumentInternet Link 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.

  • This method uses the readyState property of the XML element:
  •   if (xmldoc.readyState == "complete")
          window.alert ("The XML document is ready.");
    
  • This method uses the readystateInternet Link property of the XMLDOMDocument object:
  •   if (xmldoc.XMLDocument.readyState == 4)
          window.alert ("The XML document is ready.");
    

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!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.