Learning XML by Erik T. Ray Unconfirmed error reports are from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. This page was updated April 24, 2003. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification UNCONFIRMED errors and comments from readers: [1] Source Code; Errata listed on various pages has not been updated for the source code. [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. (16) 3rd paragraph; (a way to combined different document types) should be: (a way to combine different document types) [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? [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 [75] in the XML-1.0 spec. (34) Under "encoding"; "Japanese Katana" should be "Japanese Katakana". [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. an element can be empty: 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. (38) bottom; There is no slash (/) before the right bracket (>) in the empty element: Same error (no slash before right bracket) in numerous other empty element examples on pp. 39-40 [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. [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). [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). [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). {45} three lines to the end of the example; fish and subject. should read: fish and subject. {46} Figure 2-13: The numbered character general entity box is missing its arrow. {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. (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" {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. [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 {68} 1st paragraph; (Different ID attribute value in example on page 63 and associated comment on page 68). In marker 9 comment, the should be as in the example (page 63, marker 9) the observed element is: . OR you should change on page 63 to to match the comment on page 68. [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/learnxml/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/learnxml/desc.html"). [75] Relative URL table; the third example starts at the path: http://www.oreilly.com/catalog/learnxml/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 ../ [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. {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". (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 {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. [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 (93) Last paragraph, 2nd sentence; "just before the "I" in the string" should read "just before the "V" in the string". {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). [100] Example 3-2; xhtml 1 strict doesn't allow inline elements, like on their own. img tags require the 'alt' attribute, also in xhtml. (121) In the middle of the page: "para:first-child { font-variant: uppercase; }" Should read: "para:first-child { text-transform: uppercase; }" (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." (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." (129) 2nd paragraph: There's superfluous word "warning" in the example stylesheet. (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. [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: . ?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. {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. {149} - "ALL" should be replaced by "ANY". ?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. ?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..." [150] last-but-one line; there is no "ALL" content-model, just an "ANY". so please replace "ALL" by "ANY" (153) - "...using attribute declaration lists." (second line from bottom) This should be replaced by "...using attribute list declarations." (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). (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). (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). [156] middle of page; it should read and (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). (158) Example under "Value Already Set, ..." section: ...; Should not the references to entities in the following be preceded by the ampersand and terminated by the semicolon: (160) example; The example starts with: example; The tags in the example are missing a SYSTEM token. For example, should be The same is true for the ENTITY for "judy" {161} - - 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. {167} - Two occurrences of "#CDATA" They should be replaced by "CDATA". [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 {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. ?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). (191) last para; The text claims that must contain all 3 elements, but only the last 2 are necessary. I suspect that it is necessary to enclose the 3 els with . If true, this would apply elsewhere too. The text for the example is not on the website. {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. {202} bottom: should read: [209] Table 6-3 second colon (Matches) second row (child::*); For the same reason as confirmed errow on page 206 (insert after
"Find out which episode") child:* matches too. However, for educational reasons you should change page 204 second code block somewhere in the middle replace: Find out which episode with: Then neither page 206 nor the here reported page 209 would be wrong and the example even better! [213] top; The line of the example doesn't refernce "friend"? [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... foo tanktop10 T12 TEST.XSD... TEST.XSL... RIGHT:[] WRONG? {218} Table 6-7, "Operator" column; "expr > expr" and "expr >= expr" should be "expr > expr" and "expr > expr" should it not? [218] 2nd paragraph; "The test attribute of " should read "The test attribute of " {226} First code block, second line: Should read: {236} Start of Example 6-5; should be (as per previous version of program Example 6-4 bottom of page 232) {244} 3rd paragraph, 3rd sentence; The sentence begins: Elements such as
are converted to br, ... That should be: Elements such as
are converted to
however the whole sentence could be re-worded since changing a "/>" to ">" is an idea similar to changing "?>" to ">" . (255) 4th paragraph (1st xsl footnote template); The text reads:
#FOOTNOTE- [note] 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., #FOOTNOTE- [note] (269) Figure 7-1. Listing of ASCII codes DC1 and DC2 are given the same hexadecimal value, thus all following hexadecimal values are wrong. (274) last full paragraph, last sentence; sentence ends: ...., sohopefully your Macintosh ... should be: ...., so hopefully your Macintosh .... (missing space) (277) multiline example code; The code is not valid in no aspect: - has no closing tag, - is closed with instead of . The code should look like:

ACHTUNG

ATTENTION

[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. {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. {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: instead of $thing2