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:
0 uninitialized 1 loading 2 loaded 3 interactive 4 complete 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 readyState 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);