Not a bad book, but dissapointing nevertherless.
Most examples are short, context-less and seemingly pointless, most of them of the "hello world" variety. Few examples of real world interest.
Case in point, only one DTD is given in the chapter on DTD's. Couldn't a few more examples been given.
Also, Pattern matching (an absolutely fantastic feature) is given only brief treatment.
His lone example of selectSingleNode is
var node = xmlDoc.selectSingleNode("Catalog/Plant")
Why would you do that?
selectSingleNode is called for when working with a
unique property. Like:
var node = xmlDoc.selectSingleNode("//item[RegId = '3243']")
Want to use the appendChild method? Here is the code
example in the reference section.
docObj = xmlDoc.documentElement;
alert(docObj.xml);
objNewNode = docObj.appendChild(xmlDoc.documentElement.firstChild);
alert(docObj.xml);
Wow, that answers all my questions!
Another problem is that, except for a few examples of hierarchies, all data is tabular. But one of the great features of XML is the ability to handle entities that have multivalued attributes.
To take an example from Wrox's XML Applications a XMLbase is created for weeds where the primary attribute is the Latin botanical name and there are zero or more Spannish names and zero or more English names. This type of situation forces us to a database design that is inelegant in a relational database.
In XML it is easy!
IMHO, Wrox's XML Design and Implementation is far better.
Mark Bosley