Errata

Learning XML

Errata for Learning XML

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.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 1
Source Code

Errata listed on various pages has not been updated for the source code.

Anonymous   
Printed Page 5
xml examples for MathML and SVG

I ran both of these examples in Opera and Mozilla 1.0, and neither worked. The first
example had an error related to &InvisibleTimes. The second did not display the
image created.

Anonymous   
Printed Page 16
3rd paragraph

(a way to combined different document types)

should be:

(a way to combine different document types)

Anonymous   
Printed Page 25
3rd paragraph

The paragraph perplexes me. I am brand new to XML. The line, "This is an example of
a contextual error that a well-formedness checker would not report."

--It wouldn't report that a bulleted list was inside a paragraph?

It goes on to mention another error that says, "This is a syntactic error that a
well-formedness checker would find, too."

--As if (too), meant as in the first example which WOULD NOT. You see what I mean?

Anonymous   
Printed Page 33
figure 2-4

According to the XML spec, it is not possible to have both keywords PUBLIC *and*
SYSTEM in the declaration of an external id. It should be PUBLIC here only. see rule

Anonymous   
Printed Page 34
Under "encoding"

"Japanese Katana" should be "Japanese Katakana".

Anonymous   
Printed Page 36
3

The following example in "Elements : The Building Blocks of XML" of the
Chapter 2 : Markup and Core Concepts, shows the use of empty element tag.

<outer>an element can be empty: <nuttin//></outer>

The explaination pertaining to the empty tag (in the same page) on the last
paragraph as follows :

.... (5), and the element ends with a slash (/) and a closing angle bracket.

The example shows two slashes to close the tag, whereas the explaination for
the tag shows only 1 slash being used.

Anonymous   
Printed Page 38
bottom

There is no slash (/) before the right bracket (>) in the empty element:

<kiosk music="bagpipes" color="red" id="page-81527">

Same error (no slash before right bracket) in numerous other empty element examples
on pp. 39-40

Anonymous   
Printed Page 41
- "Two other names, xml:link and xml:attribute, are defined by

XLink ... These special attributes names are described here: ... xml:link
... xml:attribute..."
These statements are not true. XLink standard does not have those two
attribute names.

Anonymous   
Printed Page 42
- "You can declare that an element exists within a particular

namespace and that it should be validated against that namespace's DTD."
This is a misleading statement because XML Namespaces and DTDs are
completely independent. I would refer you to "Namespaces and DTDs" section
of XML in a Nutshell (pp. 69-71).

Anonymous   
Printed Page 44
- "Specifying the URL is a formality to provide additional

information about the namespace, such as who owns it and what version you're
using."
This is a misleading statement because the purpose of using URL is that
"URLs are guaranteed to be unique because they are based on domain names,
which are registered to prevent conflicts." (XML by Example, p. 77) Also,
"They are very flexible because you can create an infinite number of
namespaces from a simple root." and "It is easy to set up a Web site, if the
need arises to provide information on the namespaces." (XML by Example, p.
81).

Anonymous   
Printed Page 44
last paragraph

In the last sentence:
"Elements and attributes in the default namespace don't need the namespace
prefix, ..."

should read:

"Elements in the default namespace don't need the namespace prefix, ..."

reason:
------
The sentence "Elements and attributes in the default namespaces don't
need the namespace prefix, ..." is ambiguous and misleading. The default
namespace only applies to element names. The default namespace does not
apply to attribute names. So a prefix is required to refer to attributes
names that are in an XML namespace. But sometimes, attributes do not need
a prefix and the XML instance document is still valid. It is because the
un-prefix attributes assumed to be part of the same namespace as the element
that carries them (but not because the un-prefix attributes assumed to be
part of the default namespace).

Anonymous   
Printed Page 45
three lines to the end of the example

fish and subject.</myns:abstract>

should read:

fish and subject.<abstrac>

Anonymous   
Printed Page 46
Figure 2-13

The numbered character general entity box is missing its arrow.

Anonymous   
Printed Page 47
- "...because numbered character entities are implicitly defined

in XML as references to characters in the current character set."
Numbered character entities are always based on the Unicode character
set.

Anonymous   
Printed Page 48
Last paragraph

Reads: "...starts at zero and goes up to 65,536."

Should more accurately read: "..starts at zero and goes up to 65,535"

Anonymous   
Printed Page 51
First code snippet

The root element name in the document type declaration does not match the
name of the outermost element of the document.

Anonymous   
Printed Page 53
top

the use of"&mypic;"is not allowed here.
References to non-parsed entitities are only allowed as values of attributes of type ENTITY

Anonymous   
Printed Page 68
1st paragraph

(Different ID attribute value in example on page 63 and associated comment on page
68).
In marker 9 comment, the <xref linkend="chapt-1" /> should be <xref linkend="intro"
/> as in the example (page 63, marker 9) the observed element is: <chapter
id="intro">.
OR
you should change <chapter id="intro"> on page 63 to <chapter id="chapt-1"> to match
the comment on page 68.

Anonymous   
Printed Page 75
in the XML-1.0 spec.

Anonymous   
Printed Page 75
table near bottom of page

The first example is not correct; the absolute URL of the given relative URL
would be
"http://www.oreilly.com/catalog/9780596000462/www.oreilly.com/catalog/learnxml/de
sc.html".

If it was the author's intention to show a relative URL that included all
but the URL's scheme, the relative URL must have a double-slash at the front
("//www.oreilly.com/catalog/9780596000462/desc.html").

Anonymous   
Printed Page 75
Relative URL table

the third example starts at the path:

http://www.oreilly.com/catalog/9780596000462/index.html

Since the target document is not considered part of the relative path, the example

../../

should move up two parent levels from then original to become simply

http://www.oreilly.com/

Or, it could be fixed by using only a single climb

../

Anonymous   
Printed Page 78
3rd paragraph

in the sentence

(the keyword SYSTEM, followed by a system path or URL in quotes)

omit everything until "by". by rule [75] of the XML spec, the keyword SYSTEM must not
appear after the keyword PUBLIC has been used.

Anonymous   
Printed Page 82
figure 3-4

Figure 3-4 is a tree representation of the XML document in Example 3-1 (on the next
page). However, in the "department" elements, the diagram indicates an attribute
called "name" while the XML document and text indicates an attribute called "id".

Anonymous   
Printed Page 86
Last paragraph in "Node type" section

In printing [7/01]

Sentance reads -
For example, descendant(1,#all) matches any node, whether it is an element, positive
integer, comment, or text string.

Should read -
For example, descendant(1,#all) matches any node, whether it is an element,
processing instruction, comment, or text string

Anonymous   
Printed Page 88
2nd paragraph

The term descendant() is described as being depth-first, searching until it finds a
leaf, then backtracking. In the second paragraph, the book states "With a positive
value, the term begins at the start tag of the current element and reads forward
through the file, counting each descendant's start tag until reaching the current
node's end tag." If it is searching for the leaf node before backtracking, it should
search for descendants' end tags. The first end tag reached would be the end of the
first encountered leaf node, etc.

Anonymous   
Printed Page 89
Left diagram in figure 3.6 ("positive")

Page 85 says "descendant()" walk in depth first order. The left diagram is
not depth first (the right is).

The nodes should be relabled:
OLD CORRECTED
1 3
2 1
3 2

Anonymous   
Printed Page 93
Last paragraph, 2nd sentence

"just before the "I" in the string" should read
"just before the "V" in the string".

Anonymous   
Printed Page 94
2nd paragraph

A specific example is presented(spanning emphasized "very" through
emphasized "so"), but a generic search is given(the span doesn't actually
search for the words, but uses relative terms).

The syntax itself makes sense, but there is no block of text or code to use
as a point of reference to see that it is true, as was done with the
Relative Location Terms and Figure 3-4(p.82).

Anonymous   
Printed Page 100
Example 3-2

xhtml 1 strict doesn't allow inline elements, like <a /> on their own.
img tags require the 'alt' attribute, also in xhtml.

Anonymous   
Printed Page 121
In the middle of the page

"para:first-child { font-variant: uppercase; }"

Should read:

"para:first-child { text-transform: uppercase; }"

Anonymous   
Printed Page 121
3rd paragraph under "Position"

"Another way to examine the context of an element is to look its siblings."
should be
"Another way to examine the context of an element is to look at its siblings."

Anonymous   
Printed Page 124
Figure 4-9

Top set of "INHERITED" lines cross so that "font-family" points to
font-family" and "margin-left" points to "margin-left." The bottom set of
"INHERITED" lines do not cross, so "font-size" points to "color" and "color"
points to "font-size."

Anonymous   
Printed Page 129
2nd paragraph

There's superfluous word "warning" in the example stylesheet.

Anonymous   
Printed Page 134
Bottom of page

"xs:ID, xs:IDREF, xs:IDREF"
should read:
"xs:ID, xs:IDREF, xs:IDREFS"

More importantly, usage reads:
"Behave the same as the ID, IDREF, IDREFS in DTDs"
But I was unable to find IDREF and IDREFS discussed in the section on DTDs. It's
possible that I missed them, and I haven't gone through the entire book with a fine-
tooth comb, but I don't believe they were discussed in the DTD section.

Anonymous   
Printed Page 137
Example 4-1: The Revised XHTML Document

I got the examples files from this site.

I fixed some errors mentionned by other readers in file ex0401.xml.
And then, I tried to open it with my favorite browser (Netscape 7.1). But to my
dismay it didn't format it as specified in stylesheet ex0402.css.

The processing instruction referencing the stylesheet is missing in the XML file.
Therefore, the beginning of file ex0401.xml should be:

<?xml version="1.0"?>.
<?xml-stylesheet type="text/css" href = "ex0402.css"?>

Anonymous   
Printed Page 147
- Default Behavior Without a Document Model

I think the content of this section could be misleading, and I suggest
that you also read XML By Example, Page 213, Validating and Nonvalidating
Parsers.

Anonymous   
Printed Page 149
- "First, if there are redundant declarations (an attempt to

declare the same element type twice, for example), the first one that
appears takes precedence and all others are ignored."
This statement only applies to Attribute List and Entity declarations,
not Element Type declarations.

Anonymous   
Printed Page 149
- <!ELEMENT thingie ALL>

"ALL" should be replaced by "ANY".

Anonymous   
Printed Page 150
- "An element declaration does two things: it adds a new element

name to the language's namespace..."
This statement could be misleading because DTD does not fully implement
the XML namespace features, and the statement should be understood within
the context of XML Schema instead.

Anonymous   
Printed Page 150
- "By convention, element names are always lowercase..."

This statement could be misleading, and I suggest that you also read XML
By Example, Page 46, "There are two popular conventions for XML elements..."

Anonymous   
Printed Page 150
last-but-one line

there is no "ALL" content-model, just an "ANY".

so please replace "ALL" by "ANY"

Anonymous   
Printed Page 153
- "...using attribute declaration lists." (second line from

bottom)
This should be replaced by "...using attribute list declarations."

Anonymous   
Printed Page 155
- "A name token is a string ... contain numbers, letters, and

certain punctuation."
It would be better stated that a name token is an "XML Token" (see class
notes).

Anonymous   
Printed Page 156
- "An ID attribute has the same behavior and syntax as

NMTOKEN..."
It would be better stated that an ID attribute is an "XML Name" (see
class notes).

Anonymous   
Printed Page 156
- "ENTITY (entity name) This type accepts a general entity name

as a value."
It would be better stated that an ENTITY name is an unparsed entity's
name (see class notes).

Anonymous   
Printed Page 156
middle of page

it should read

<!ATTLIST recor id ID #REQUIRED>

and

<!ATTLIST related word IDREF #REQUIRED>

Anonymous   
Printed Page 157
- "ENTITIES (entity name list) The value of this attribute is

a list of entity names separated by spaces."
It would be better stated as "a list of unparsed entities' names
separated by space." (see class notes).

Anonymous   
Printed Page 158
Example under "Value Already Set, ..." section

<!ATTLIST car color (beige, white, black...

should read:

<!ATTLIST car color (beige | white | black ...

Anonymous   
Printed Page 160
in XML <doc>...</doc>

Should not the references to entities in the following

<doc>
<graphic sources="bob"/>
<graphic cources="judy"/>
</doc>

be preceded by the ampersand and terminated by the semicolon:

<doc>
<graphic sources="&bob;"/>
<graphic cources="&judy;"/>
</doc>

Anonymous   
Printed Page 160
example

The example starts with:

<?xml version="1.0"?>
<!DOCUMENT doc [

Shouldn't it read "DOCTYPE" instead of "DOCUMENT"?

Anonymous   
Printed Page 160
<doc> example

The <!ENTITY > tags in the <doc> example are missing a SYSTEM token.

For example,
<!ENTITY bob "pictures/bob.jpeg" NDATA jpeg>
should be
<!ENTITY bob SYSTEM "pictures/bob.jpeg" NDATA jpeg>

The same is true for the ENTITY for "judy"

Anonymous   
Printed Page 161
- <!DOCTYPE record [

"record" should be "doc".

Anonymous   
Printed Page 161
Code Snippet after 3rd paragraph

Firstly... shouldn't line 2
<!DOCUMENT doc [
should be
<!DOCTYPE doc [

Anonymous   
Printed Page 163
- Subsection on "Nonparsed external entity"

"Nonparsed" should be "Unparsed". Also, "Reference the entity as
&logo;" is incorrect. Instead, the reader should be directed to the warning
note at the top of Page 161.

Anonymous   
Printed Page 167
- Two occurrences of "#CDATA"

They should be replaced by "CDATA".

Anonymous   
Printed Page 168
just below the middle of the page, in the section "main elements"

I believe that the attribute "number" belongs to the element "payment" not to the
element "deposit", as your example has it, it should be moved from the ATTLIST for
deposit to the ATTLIST for payment. Also, my parser says that there should not be a
hash mark before the word "CDATA". I believe the text should read:
"number CDATA #IMPLIED>

Anonymous   
Printed Page 173
- "If there are multiple declarations for the same element

name, the first one seen by the XML processor is used and the rest are
ignored."
This statement is false. It would be true if "element" is replaced by
"entity". Also, ignore the subsequent example of <!ELEMENT plyhedron...
because it is incorrect.

Anonymous   
Printed Page 174
bottom, in code

the line of code:

<![%use-disclaimer;[[

should be:

<![%use-disclaimer;[

Anonymous   
Printed Page 175
- Description and example of nested conditional sections

I found them rather confusing and the XML 1.0 specification did not
help much either. I will try to find a book which provides better
description and examples.

Anonymous   
Printed Page 189
- "XML Schema (sometimes referred to as XSchema)..."

This statement is incorrect. XSchema
(http://www.simonstl.com/xschema/) is the predecessor of DDML (Document
Definition Markup Language), a W3C Note.

Anonymous   
Printed Page 191
- "Though names aren't required, it's a good idea to use them

for your own sanity."
The author should elaborate on the differences between "Named Type" and
"Anonymous Type". I would refer you to the descriptions in XML by Example
(p. 111) and XML in a Nutshell (pp. 265-267).

Anonymous   
Printed Page 191
last para

The text claims that <census> must contain all 3 elements, but only the last 2 are necessary.

I suspect that it is necessary to enclose the 3 els with <xsd:sequence>. If true, this would apply elsewhere too.

The text for the example is not on the website.

Anonymous   
Printed Page 192
- "A string type is ordinary character data like the CDATA type

in DTD parlance."
I think the author meant to say "#PCDATA" rather than CDATA. See p.
151 for description of #PCDATA.

Anonymous   
Printed Page 202
bottom

<?xml-stylesheet type="text/xml" href="mytrans.xsl"?>

should read:

<?xml-stylesheet type="text/xsl" href="mytrans.xsl"?>

Anonymous   
Printed Page 209
Table 6-3 second colon (Matches) second row (child::*)

For the same reason as confirmed errow on page 206
(insert after <blockquote> "Find out which episode")
child:* matches <comment> too.

However, for educational reasons you should change
page 204 second code block somewhere in the middle

replace:

<comment>
Find out which episode
</comment>

with:

<!-- Find out which episode -->

Then neither page 206 nor the here reported page 209 would be wrong
and the example even better!

Anonymous   
Printed Page 213
top

The line of the example <xsl:template match="@type"> doesn't refernce
"friend"?

Anonymous   
Printed Page 214
bottom of page

Item3 says that stuff/cruft patterns take precedence over stuff/* patterns. However,
when I try this with eXcelon Stylus Studio and also with XALAN-J 2.2.0 and XERCES
1.4.4 directly, both give stuff/* higher precedence.
e.g. the following XSL outputs "WRONG? WRONG? WRONG?"
[[[ P.S. try changing the priority on items/* template to -1 ]]]

TEST.XML...
<?xml version="1.0"?>
<items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="test.xsd">
<product><name>foo</name></product>
<shirt><name>tanktop</name><size>10</size></shirt>
<product xsi:type="ShirtType"><name>T</name><size>12</size> </product>
</items>

TEST.XSD...
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="items">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="product" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element name="product" type="ProductType"/>
<xsd:complexType name="ProductType">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>

<xsd:element name="shirt" type="ShirtType" substitutionGroup="product"/>
<xsd:complexType name="ShirtType">
<xsd:complexContent>
<xsd:extension base="ProductType">
<xsd:sequence>
<xsd:element name="size" type="xsd:integer"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>

TEST.XSL...
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="items/product">
RIGHT:[<xsl:value-of select="name"/>]
</xsl:template>
<xsl:template match="items/*">WRONG? </xsl:template>
</xsl:stylesheet>

Anonymous   
Printed Page 218
Table 6-7, "Operator" column

"expr > expr" and "expr >= expr"

should be

"expr &gt; expr" and "expr &gt; expr"

should it not?

Anonymous   
Printed Page 218
2nd paragraph

"The test attribute of <xsl:while>"

should read

"The test attribute of <xsl:when>"

Anonymous   
Printed Page 226
First code block, second line

<xsl:attribute name="id"/>

Should read:

<xsl:attribute name="id">

Anonymous   
Printed Page 236
Start of Example 6-5

<head> should be <head/> (as per previous version of program Example 6-4 bottom of
page 232)

Anonymous   
Printed Page 242
3rd, 4th, and 5th code snippets

When referencing the $PIP, $thing1 and $thing2 xsl variables, they should be
enclosed in an xsl value-of tag, as follows:

<xsl:variable name="thing1">
<xsl:value-of select="$thing2"/>
</xsl:variable>

instead of

<xsl:variable name="thing1">
$thing2
</xsl:variable>

Anonymous   
Printed Page 244
3rd paragraph, 3rd sentence

The sentence begins:

Elements such as <br/> are converted to br, ...

That should be:

Elements such as <br/> are converted to <br>

however the whole sentence could be re-worded since changing a "/>" to ">" is an idea
similar to changing "?>" to ">" .

Anonymous   
Printed Page 255
4th paragraph (1st xsl footnote template)

The text reads:

<xsl:template match="footnote">
<a>
<xsl:attribute name="href">
<xsl:text>#FOOTNOTE-</xsl:text>
<xsl:number value="count( preceding::footnote ) +1"/>
</xsl:attribute>
<xsl:text>[note]</xsl:text>
</a>
</xsl:template>

This needs to add the "apply-templates" element so that the
following child node template(match="footnote/para") will
print the contents of the footnote. I.E.,

<xsl:template match="footnote">
<a>
<xsl:attribute name="href">
<xsl:text>#FOOTNOTE-</xsl:text>
<xsl:number value="count( preceding::footnote ) +1"/>
</xsl:attribute>
<xsl:text>[note]</xsl:text>
</a>
<xsl:apply-templates/>
</xsl:template>

Anonymous   
Printed Page 269
Figure 7-1. Listing of ASCII codes

DC1 and DC2 are given the same hexadecimal value, thus all following
hexadecimal values are wrong.

Anonymous   
Printed Page 274
last full paragraph, last sentence

sentence ends:

...., sohopefully your Macintosh ...

should be:

...., so hopefully your Macintosh ....

(missing space)

Anonymous   
Printed Page 277
multiline example code

The code is not valid in no aspect:

- <xsl:choose> has no closing tag,
- <xsl:when test="lang('de')"> is closed with </if>
instead of <xsl:when>.

The code should look like:

<xsl:template match="para">
<xsl:choose>
<xsl:when test="lang('de')">
<h1>ACHTUNG</h1>
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<h1>ATTENTION</h1>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

Anonymous   
Printed Page 294
After my %frefs

Correction on 301 needs to also have

my %space_after_start;

inserted into code. A good place is after Line 56.

Anonymous   
Printed Page 301
Example 8-2

Original error was omission of subroutine space_after_start.

Correction supplied does not work either - Hash %space_after_start not
defined.

Anonymous