Errata for XSLT Quickly are located below.
If you find any errors in the book, feel free to notify the author by taking part in our Author Online Forum.
Thanks again to all the readers who took the time to point these out.
Page 8 in the paragraph beginning "You also":
(shown as a slash in the diagram)
should say
(shown as "(root)" in the diagram)
Page 14 In the last paragraph, the sentence beginning "To rename the year attribute to vintage, the year start-tag includes" should instead begin "To rename the year attribute to vintage, the wine start-tag includes"
Page 15 In the first paragraph, "convert the grape attribute in the following to a product subelement" should read "convert the grape attribute in the following to a category subelement."
Page 19 Remove paragraph. This was part of a section on XSLT 1.1 that was there until it became official that the W3C wasn't going to follow through on 1.1. When I deleted it, I guess I left a paragraph behind!
Page 32 Ignore (remove) the emphasis start- and end-tags in example at bottom of page. In the preparation of the examples for the book, these were supposed to set the text between them in bold, like the two empty test elements on the following page.
Page 42 In xq77.xsl (the second example on the page), the XPath expression "prices/retail" should read "price/retail" without the "s."
Page 51 In xq99.xsl, the line beginning 1. List price should have <xsl:value-of select="."> between the curly braces and not <xsl:apply-templates/>.
Page 68 In the paragraph beginning "How can a template," the reference to the nonexistent normalize-string() function should actually refer to the normalize-space() function.
Page 75
xq160.xsl stylesheet: contains(,'the')
should be
contains(.,'the') i.e. add a period before the comma.
This mistake is not in the copy of xq160.xsl included in the downloadable zip file of sample code, so that will work as described by the book.
Page 101 Numbered list item 2 a little below the middle of the page: this should end with 'the local name is "verse"' and not 'the local name is "blue".'
Page 119 In the line after the line with "The Lake with Liquid Fire," "pic1.jpg" should be "pic3.jpg"
Page 123 At the top: "the following template illustrates" should read "the following template rule illustrates"
Page 134
"WARNING": Some processors ignore the xsl:message element. Under Windows, Mozilla 1.5 and Internet Explorer 6.0 ignore it unless the terminate attribute is set to "yes", which causes both to display an error message; Internet Explorer displays the xsl:message contents as well.
Page 148
In xq620.xsl, select="xalan:tokenize(.",")"
should say
select="xalan:tokenize(.,",")" (i.e. add a comma added after the period.)
This mistake is not in the copy of xq620.xsl included in the downloadable zip file of sample code, so that will work as described by the book.
Page 148
In the paragraph beginning "For the processor," 'namespace prefix ("saxon")'
should say
'namespace prefix ("xalan")'
Page 174
In the call to the key() function in the example at the bottom, the second parameter should be @colorCode and not @color. This is done correctly in the xq481.xsl stylesheet included with the zip file of sample and runs properly.
Page 185
In the definition of location step:
"wines/wine/attribute:year"
should be
"wines/wine/attribute::year" (i.e. two colons after the axis specifier.)
Page 196
In the output shown at the bottom, the three shirt elements' attributes should be colorCode, not color (colorCode="c4", colorCode="c1", colorCode="c6"). This is what you'll see if you run xq486.xsl with xq484.xml as input, because it's just copying those shirt elements from xq484.xml. The xq491.xml output file in the zip file of sample code has the same mistake.
Page 209 The first line of the example at the top of the page should say that xq403.xsl "converts xq402.xml into xq404.txt" and not "into xq404.xsl."
Page 226
Near the top, where it says DOCTYPE chapter PUBLIC PUBLIC it should say DOCTYPE chapter PUBLIC (i.e. "PUBLIC" only once).
Page 226
End of paragraph beginning "The XML parser should look...": Join the two sentences "Because it's a required parameter. The XML parser knows what it is." Into "Because it's a required parameter, the XML parser knows what it is."
Page 226
Near the bottom, the reference to the xsl:doctype-public attribute should read doctype-public attribute (without the xsl:).