
“href=\”prices.css\” type=\”text/css\””),
topLevel = document.documentElement;
document.insertBefore(comment,topLevel);
document.insertBefore(stylesheet,comment);
}
function getText(node)
{
return node.firstChild.data;
}
274
Chapter 9: Writing XML
Listing 9.3: continued
OUTPUT
Figure 9.1: Result in a browser
This example displays the XML document in a form. The section “Doing
Something with the XML Documents” explains how to save it.
Inserting Nodes
1. Most of Listing 9.3 is familiar. It walks through the price list and
converts prices from American dollars to Euros. The novelty is that it
inserts a new price element in the price list with the price in Euros. ...