XSLT

Errata for XSLT

Submit your own errata for this product.


The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update



Version Location Description Submitted By Date Submitted Date Corrected
Safari Books Online
?
1.2.2.11. Namespaces

<begin excerpt> <xyz xmlns:books=

Note from the Author or Editor:
The paragraph should read as follows: In this example, the xmlns:books attribute associates the prefix books with one namespace, and the xmlns:addr attribute associates the addr prefix with another namespace. This means that a title element from the books namespace would be coded as <books:title>, while a title element from the addr namespace would be referred to as <addr:title>. Here is the DocBook source: <para>In this example, the <literal>xmlns:books</literal> attribute associates the prefix <literal>books</literal> with one namespace, and the <literal>xmlns:addr</literal> attribute associates the <literal>addr</literal> prefix with another namespace. This means that a <literal>title</literal> element from the <literal>books</literal> namespace would be coded as <literal>&lt;books:title&gt;</literal>, while a <literal>title</literal> element from the <literal>addr</literal> namespace would be referred to as <literal>&lt;addr:title&gt;</literal>.</para>

Anonymous  Aug 27, 2008 
Safari Books Online
http://my.safaribooksonline.com/9780596527211/xslt-CHP-3
Section 3.1.1.1, paragraph 2 and preceding XML document example

Reference is made to a processing instruction

Note from the Author or Editor:
The <?cocoon-process?> processing instruction was removed in the second edition. The paragraph should read as follows: Unlike other nodes, the root node has no parent. It always has at least one child, the document element. The root node also contains comments or processing instructions that are outside the document element. In our sample document, the processing instruction named xml-stylesheet is a child of the root node, as are the comments that appear before the <sonnet> tag and the comments that appear after the </sonnet> tag. The string value of the root node (returned by <xsl:value-of select="/" />), is the concatenation of all text nodes of the root node's descendants, slammed together without any spaces between them.

Mary Garcia  May 30, 2009 
Printed
Page xvii
middle

The author gives credit to Patricia Walmsley. Her first name is actually Priscilla.

Note from the Author or Editor:
The acknowledegment should be to Priscilla Walmsley. Priscilla, my apologies.

Anonymous  Jan 19, 2009  Feb 01, 2010
Safari Books Online
1.2.2.3
Second example in the section

In demonstrating quoted attributes values with quotes inside the following examples are shown <book title=

Note from the Author or Editor:
The text should appear as follows: <book title="XSLT, Second Edition" publisher="O'Reilly"/> <book title="XSLT, Second Edition" publisher='O&apos;Reilly'/> Here is the DocBook source: <programlisting> &lt;book title="XSLT, Second Edition" publisher="O'Reilly"/&gt; &lt;book title="XSLT, Second Edition" publisher='O&amp;apos;Reilly'/&gt;</programlisting>

solecism  Mar 21, 2009 
Safari Books Online
2.4.5.1
Second example

In section 2.4.5.1, the example document shown is <?xml version=

Note from the Author or Editor:
The final tag at the top of the page should be </x> instead of </z>. The text should appear as follows: <?xml version="1.0"?> <x> <y> <z/> </y> </x> Here is the DocBook source: <programlisting>&lt;?xml version="1.0"?&gt; &lt;x&gt; &lt;y&gt; &lt;z/&gt; &lt;/y&gt; &lt;/x&gt;</programlisting>

solecism  Mar 21, 2009 
Printed
Page 55
Output example, just above Location Paths heading

In the

Note from the Author or Editor:
I accidentally copied part of the stylesheet into the output. The last line of output at the top of the page should be: Atomic value: Timbuktu.

Andrew Beckett  Mar 01, 2009 
Printed
Page 69
Date and Time values, Third paragraph, last sentence

Date: Wed, 1 Apr 2009 08:02:31 -0700 (PDT) From: Leslie Crandell <lcrandell@oreilly.com> To: booktech <booktech@oreilly.com> Subject: Fwd: logic error in example Please see below email from customer. Leslie Crandell Senior Corporate Account Manager O'Reilly Media, Inc. Phone: 800-773-6450 Concord Office Phone: 800-998-9938 x 7073 Sebastopol Office E-mail: lcrandell@oreilly.com http://www.oreilly.com ----- Forwarded Message ----- From:

Note from the Author or Editor:
The correct UTC value is 22:30:22.183Z. The examples should be updated to use 55 seconds instead of 22 to avoid confusion. The text should appear as follows: Date and time values: There are three datatypes for dates and times: xs:date, xs:time and xs:dateTime. The format of a date is YYYY-MM-DD, as in 1995-04-21 for April 21st, 1995. A time value is in the format hh:mm:ss.sss, so 19:38:55.183 is the same as 55.183 seconds past 7:38 p.m. Both xs:date and xs:time values have an optional time zone indicator, indicated by a plus or minus sign (+ | -) that indicates that the date or time is some number of hours ahead or behind Coordinated Universal Time (UTC, also known as Greenwich Mean Time). For example, during the winter (when Daylight Savings Time is not in effect), the time zone on the East coast of the United States is -05:00. Be aware that if the XSLT processor normalizes a date or time value, parts of the value can change. The time value 19:30:55.183-05:00 is the same as the time value 00:30:55.183Z (a date or time value that ends with Z has been normalized to UTC). Finally, a xs:dateTime value is the combination of an xs:date and an xs:time. The written representation of an xs:dateTime has a T between the two portions. To combine our earlier examples, 1995-04-21T19:38:55.183-05:00 is 55.183 seconds past 7:38 p.m. on April 21st, 1995, five hours behind UTC. That value is equivalent to 1995-04-22T00:38:55.183Z. Be aware that xs:date, xs:time and xs:dateTime can have negative values. Here is the DocBook source: <varlistentry> <term>Date and time values</term> <listitem> <para>There are three datatypes for dates and times: <literal>xs:date</literal>, <literal>xs:time</literal> and <literal>xs:dateTime</literal>. The format of a date is <literal>YYYY-MM-DD</literal>, as in <literal>1995-04-21</literal> for April 21st, 1995. A time value is in the format <literal>hh:mm:ss.sss</literal>, so <literal>19:38:55.183</literal> is the same as 55.183 seconds past 7:38 p.m. </para> <para>Both <literal>xs:date</literal> and <literal>xs:time</literal> values have an optional time zone indicator, indicated by a plus or minus sign (<literal>+ | -</literal>) that indicates that the date or time is some number of hours ahead or behind Coordinated Universal Time (UTC, also known as Greenwich Mean Time). For example, during the winter (when Daylight Savings Time is not in effect), the time zone on the East coast of the United States is <literal>-05:00</literal>. Be aware that if the XSLT processor normalizes a date or time value, parts of the value can change. The time value <literal>19:30:55.183-05:00</literal> is the same as the time value <literal>00:30:55.183Z</literal> (a date or time value that ends with <literal>Z</literal> has been normalized to UTC).</para> <para>Finally, a <literal>xs:dateTime</literal> value is the combination of an <literal>xs:date</literal> and an <literal>xs:time</literal>. The written representation of an <literal>xs:dateTime</literal> has a <literal>T</literal> between the two portions. To combine our earlier examples, <literal>1995-04-21T19:38:55.183-05:00</literal> is 55.183 seconds past 7:38 p.m. on April 21st, 1995, five hours behind UTC. That value is equivalent to <literal>1995-04-22T00:38:55.183Z</literal>. </para> <para>Be aware that <literal>xs:date</literal>, <literal>xs:time</literal> and <literal>xs:dateTime</literal> can have negative values. </para> </listitem> </varlistentry>

Anonymous  Apr 01, 2009 
Printed
Page 70
Last paragraph on the page

The text says,

Note from the Author or Editor:
In the last sentence on the page, the text should not say that a xs:yearMonthDuration has a days component. The paragraph should look like this: xs:yearMonthDuration and xs:dayTimeDuration These two types were added to the XML Schema datatypes namespace by the XPath 2.0 and XQuery 1.0 Data Model spec. They represent the two halves of a xs:duration. An xs:yearMonthDuration is some number of years and months, while an xs:dayTimeDuration is some number of days, hours, minutes and seconds. Both of these datatypes can have negative values. The duration 12 years and 2 months is written P12Y2M. Note that an xs:yearMonthDuration doesn't have a days component. The duration 4 days, 7 hours, 47 minutes and 32.883 seconds is written P4DT7H47M32.883S. Here is the DocBook source: <varlistentry> <term><literal>xs:yearMonthDuration</literal> and <literal>xs:dayTimeDuration</literal></term> <listitem> <para>These two types were added to the XML Schema datatypes namespace by the XPath 2.0 and XQuery 1.0 Data Model spec. They represent the two halves of a <literal>xs:duration</literal>. An <literal>xs:yearMonthDuration</literal> is some number of years and months, while an <literal>xs:dayTimeDuration</literal> is some number of days, hours, minutes and seconds. Both of these datatypes can have negative values. The duration 12 years and 2 months is written <literal>P12Y2M</literal>. Note that an <literal>xs:yearMonthDuration</literal> doesn't have a days component. The duration 4 days, 7 hours, 47 minutes and 32.883 seconds is written <literal>P4DT7H47M32.883S</literal>.</para> </listitem> </varlistentry>

Anonymous  Jul 22, 2008 
Printed
Page 79
First paragraph under the section labeled "[2.0] Integer division (idiv)"

The text says,

Note from the Author or Editor:
Change the paragraph under the heading "[2.0] Integer division (idiv)" to read: XPath 2.0 introduces the idiv operator for integer division. No rounding is done if there is any remainder from the division. Changing our earlier div example to use idiv, we have to remove a couple of error cases: Here is the DocBook source: <para>XPath 2.0 introduces the <literal>idiv</literal> operator for integer division. No rounding is done if there is any remainder from the division. Changing our earlier <literal>div</literal> example to use <literal>idiv</literal>, we have to remove a couple of error cases:</para>

Anonymous  Jul 22, 2008 
Safari Books Online
90
This is for the Safari version - Section 2.4.6 - there are no page numbers on Safari

Scattered throughout the text are many references labelled [click here] instead of labelled with the actual text. Section 2.4.6 is one of many examples. Note: The page number listed is not accurate - I had to make one up because you listed it as a required field - Safari doesn't have page numbers.

Note from the Author or Editor:
This problem seems to exist only in the Safari version of the book, and only in the glossary. The text "[click here]" should be replaced with the name of the glossary entry to which it refers. The errors occur in these glossary entries: * document node * [2.0] dynamic context * [2.0] static context document node In a tree created from a well-formed XML document, the [click here] will be a document node with exactly one [click here] as its child. That element node represents the [click here], and does not have any text nodes as children. An XML parser will only create document nodes from well-formed XML documents. However, it is possible within an XSLT stylesheet to create a document node that is not well-formed. See the discussion of the <xsl:document> element for an example. The three instances of "[click here]" should be replaced with the text "root node," "element node," and "document node," respectively. [2.0] dynamic context The portion of the context that can change during the evaluation of a stylesheet or XPath expression. The context item, context size, and context position are all part of the dynamic context. See Section 3.2.1.2" in Chapter 3 for a complete description of everything in the context. Compare with [click here]. The "[click here]" text should be replaced with the text "[2.0] static context." [2.0] static context The portion of the context that is known before an XML source document is processed. See Section 3.2.1.2" in Chapter 3 for a complete description of everything in the context. Compare with [click here]. The "[click here]" text should be replaced with the text "[2.0] dynamic context."

Anonymous  Aug 13, 2008 
Printed
Page 197
Paragraphs 1-4

The text at the top of page 197 is referring to country-index and part-index keys, neither of which appear in the style sheet on the previous page. The keys are called called supplier-by-country and part-by-supplier in the stylesheet.

Note from the Author or Editor:
The key names in the two examples at the top of the page are incorrect. The key names (not the variable names) should be changed to supplier-by-country and part-by-supplier. Here's how the code listings should look: <xsl:when test="key('supplier-by-country', $country-name)"> <xsl:for-each select="key('supplier-by-country', $country-name)"> <xsl:apply-templates select="."/> </xsl:for-each> </xsl:when> and <xsl:for-each select="key('part-by-supplier', @vendor-id)">

Andrew Beckett  Mar 01, 2009 
Printed
Page 201
1st paragraph

The paragraph

Note from the Author or Editor:
The last sentence in the note at the top should say, "...it is a fatal error to pass a sequence with more than one node to the generate-id() function...." It currently says "...the key() function..." instead.

Andrew Beckett  Mar 01, 2009 
Printed
Page 212
Middle of page

There is a line saying (See sort-datatype-number1.xsl for the complete stylesheet). This is not shown anywhere (just above the line, there is a truncated version of sort-datatype-number1.xsl).

Note from the Author or Editor:
The stylesheet does not appear in the book, although it is in the example zip file on the Web site. Probably the best way to handle this is to take out the reference entirely. The comment at the top of the excerpt contains the file name, so readers should be able to find it. Adding the text of the entire stylesheet would change all the page breaks in Chapter 7.

Andrew Beckett  Mar 01, 2009 
Printed
Page 291
bottom of page

For some reason, the words

Doug Tidwell
Doug Tidwell
O'Reilly Author 
Jul 05, 2009 
Printed
Page 358
Middle of the page

The sample stylesheet here is out of sync with the actual example. The stylesheet in the book will work, but the sample posted on the Web site exits gracefully if the dotnet:getPhotoListing() function is not available. The example should be replaced with the following: <?xml version=

Doug Tidwell
Doug Tidwell
O'Reilly Author 
Jul 05, 2009 
Printed
Page 410
Top of the page

Get rid of the extraneous

Doug Tidwell
Doug Tidwell
O'Reilly Author 
Jul 05, 2009 
Printed
Page 459
XSLT sample at the bottom of the page

The filename in the comment should be namespace-alias2.xsl, not namespace-alias-2.xsl.

Doug Tidwell
Doug Tidwell
O'Reilly Author 
Jul 05, 2009 
Printed
Page 460
Second XSLT sample on the page

The filename in the comment should be namespace-alias3.xsl, not namespace-alias-3.xsl.

Doug Tidwell
Doug Tidwell
O'Reilly Author 
Jul 05, 2009 
Printed
Page 688
XML sample at the top of the page

The filename in the comment should be parts-list2.xml, not parts-list2.xsl. (.xml, not .xsl.)

Doug Tidwell
Doug Tidwell
O'Reilly Author 
Jul 05, 2009 
Printed
Page 898
XSLT sample in the middle of the page

In the example in the middle of the page, I [this is submitted by the author] used the advanced coding (\p{{Nd}}{{3}}), but I don't explain the \p modifier or the Nd character group until later in the appendix. Please take this out and use the simpler markup ([0-9]{{3}}) instead. So instead of: <xsl:analyze-string select=

Doug Tidwell
Doug Tidwell
O'Reilly Author 
Jul 05, 2009 
Printed
Page 922
Middle of the page

The ordinal presentation modifier (

Doug Tidwell
Doug Tidwell
O'Reilly Author 
Jul 05, 2009