Using XML Data Islands

As of version 5 in Internet Explorer, you can also use XML data islands to actually embed XML inside HTML pages. Internet Explorer supports an HTML <XML> element (which is not part of the HTML standard) that you can simply enclose an XML document inside, like this:

<XML ID="greeting"> 
    <DOCUMENT>
        <GREETING>Hi there XML!</GREETING>
    </DOCUMENT>
</XML>

The Internet Explorer <XML> element has some attributes worth noting:

  • ID— The ID with which you can refer to the <XML> element in code. Set to an alphanumeric string.

  • NS— The URI of the XML namespace used by the XML content. Set to a URI.

  • PREFIX— Namespace prefix of the XML contents. Set to an alphanumeric string.

  • SRC— Source for the XML document, if the document is external. ...

Get Real World XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.