You are here: Reference > JavaScript > client-side > HTML DOM > properties > XMLDocument (xml)

XMLDocument property (xml)

Browser support:
9
Returns a reference to the XMLDocument object that represents the contents of an xml element.
Note: The support for the XMLDocument property has been removed in Internet Explorer 9.
Internet Explorer allows the insertion of XML documents directly to a HTML document with the xml element. The XMLDocument property can be used to retrieve an XMLDocument object representing the embedded XML data island.

Syntax:

object.XMLDocument;
You can find the related objects in the Supported by objects section below.
This property is read-only.

Possible values:

Reference to a XMLDocument object.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the XMLDocument property:
<head>
    <script type="text/javascript">
        function DisplayXMLIsland () {
            var xmlIsland = document.getElementById ("xmlIsland");
            if (xmlIsland.XMLDocument) {
                alert (xmlIsland.XMLDocument.xml);
            }
            else {
                alert ("Your browser doesn't support the XMLDocument property.");
            }
        }
    </script>
</head>
<body>
    <xml id="xmlIsland">
        <movie>
            <name>Clark Kent</name>
            <jobtitle>Superman</jobtitle>
            <born>1966</born>
        </movie>
    </xml>
    <button onclick="DisplayXMLIsland ()">Get the contents of the XML island</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content