7.3. The heavyweight champion: XML
You've already seen how a server can return XML in response to your request:
PHP script
<?xml version="1.0" encoding="utf-8"?>
<totals>
<boards-sold>1710</boards-sold>
<boots-sold>315</boots-sold>
<bindings-sold>85</bindings-sold>
</totals>
Here's the XML that the Boards 'R' Us server sent back in Chapter 6.
You work with XML using the DOM.
XML has been around the block... and you already know how to use the DOM to work with XML data..
7.3.1. You use the DOM to work with XML
Internet Explorer
Firefox
Web Browser
Opera
Safari
Mozilla
getNew Totals()
JavaScript
In your JavaScript, you use the DOM to work with a server's XML response.
totals
boards-sold bindings-sold
boots-sold
1710" 85"
Here's the DOM tree for that XML document...
"315"
...and here's a little bit of DOM code from Chapter 6.
 |