Extensible Markup Language (XML)

CSE 190 M (Web Programming), Spring 2007

University of Washington

Reading: Sebesta Ch. X sections ***

Valid XHTML 1.0 Strict Valid CSS!

What is XML?

Structure of an XML document

example XML file

<?xml version="1.0" encoding="UTF-8"?>
<note>
    <to>Tove</to>
    <from>Jani</from>
    <subject>Reminder</subject>
    <body>
        Don't forget me this weekend!
    </body>
</note>

What tags are legal in XML?

Where does XML data come from?

XML pros and cons

Displaying XML data

DOM node properties/methods

Details about XML node properties

Reading an XML document using AJAX

var ajax = new XMLHttpRequest();
ajax.open("GET", url, false);
ajax.send(null);
var xmlDoc = ajax.responseXML;
do something with xmlDoc;
  • document.implementation.createDocument accepts some parameters related to XML namespaces, but we don't need them so we just pass empty strings and null