Corrections to Chapter 9 of XML in a Nutshell, 2nd edition, XPath

p. 156, Figure 9-1:

p. 161: The node() wild card also matches the root node. Thus in the sixth paragraph change "The node() wildcard matches not only all element types but also text nodes, processing instructions nodes, ..." to "The node() wildcard matches not only all element types but also the root node, text nodes, processing instructions nodes, ..."..

p. 168: The select attribute in the last code fragment needs to add 1 to get the actual century. I forgot that 1978 is in the 20th century instead of the 19th, 1878 is in the 19th century instead of the 18th, and so forth. The fragment should read:

<xsl:template match="person">
  <century>
    <xsl:value-of select="((@born - (@born mod 100)) div 100) + 1"/>th
  </century>
</xsl:template>

[ XML in a Nutshell Corrections | XML in a Nutshell Home Page | Table of Contents | Examples | Order from Amazon ]

Copyright 2002-2004 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified March 24, 2004