XML = Extensible Markup Language

HTML minus the formatting information. Designed to convey information rather than layout.


    <?xml version="1.0"?>
        <NAME>Dave Brankin</NAME>
        <LINE1>10 Somewhere Road</LINE1>

Well-formed XML

Note: "Well-formed XML" is a term, not a description!

Using XML with IE

XML can be processed within IE using an ActiveX object:

    var myXMLDoc = new ActiveXObject("Microsoft.XMLDOM")
    myXMLDoc.async=false                <--- controls whether entire file has to be read before processing starts
    var rootElement = cmlDox.documentElement
    mySpan.innerText = rootElement.childNodes.item(0).text

I'm not going into further details as (a) I think we're unlikely to use this client-side approach with the .NET infrastructure and (b) I think ActiveX in browsers may be a bit of a no-no for some clients.

Data Islands

XML incorporated within a HTML document is referred to as a "data island". Basically, just encase the XML in the <XML> tag. The ID attribute of the <XML> tag is used to give us the required "hook" into the data. For example:

<XML ID="dave">
    var xml=dave
    var root = xml.documentElement

Note: No ActiveX component! ?? So why did we need one earlier? ?? The "var xml=dave" line performs the equivalent operation.

Note: The <XML> tag also supports the SRC attribute which allows an external XML file to be specified.