Errata


Print Print Icon

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



Version Location Description Submitted By
Printed Page ch 3
has to do with missing info regarding the example online

the online examples for the 3rd edition book are missing many/some sample .xml, .xsd, .dtd files that are referenced in the text;

i found most of what i'm looking for -- have not validated entire book -- by doing both of the following.

the U-R-What box on page 47 -- references a URI/URL -- by investigating this URL -- i found some of the xml, dtd files mentioned in the book but not contained in the examples/samples; no where was it mentioned that it was necessary to actually go to this website to find files mentioned in the book. --see page 48 reference to play.dtd

other places -- for example page 51 where discussing example code for setDocumentLocator -- is not present in the example program for ch3 or any other chapters -- i searched all the examples -- but i did find the referenced code in the examples provided for ch3 for the 1st edition book. also the file contents.xml referenced on page 47 does not exist in the examples for 3rd edition book -- but i did find said file in the 1st edition book samples.

gary bello 
Printed Page 25
1st paragraph

There is a url listed to download a version of "Relaxer", an application to transform
an XML document into a DTD or XSD. In fact this url returns "GONE" when accessed.
Here is the specific download url.
http://www.relaxer.jp/download/relaxer-1.0.zip

Anonymous 
Printed Page 45
Second Section - Instantiating a Reader

The sample code provided for Chapter 3 contains the "finished" code for the SAXTreeViewer class. It
includes a reference to a SimpleEntityResolver class. If you try to use the sample code it won't compile
because you don't have this other class.

Turns out the class is defined and discussed in Chapter 4 - but there is no reference to that in the
sample code.

In order to run the Ch 3 sample I had to google the class name (SimpleEntityResolver) and run across the
PDF of Chapter 4 of the book since the class is not mentioned in the book's index either.

Code examples should (IMO) work as provided or have big comments at the top defining what is missing (to
be done) before the code will work.

Anonymous 
Printed Page 46
7 lines from bottom

A method is called that has never been defined:
viewer.init(args[0]);
It is defined in the downloaded examples but even then there are problems in the init method, e.g.:

// Build the tree model
defaultTreeModel = new DefaultTreeModel(base);
jTree = new JTree(defaultTreeModel);

It just seems like book and code were hastily done, based on the three chapters I've read so far.

I've enjoyed it but it's been difficult to get this example to work correctly. It worked well once I did however. Perhaps this was never intended to be a complete working example. But it is about 90% complete so you don't really realize until you're done that parts of the file are missing and only in the downloaded examples.

Anonymous 
Printed Page 46
Two statements prior to the "catch" block toward the bottom of the page

The statement reads as follows:

viewer.init(args[0]);

There is no "init()" method available.

aspsa 
Printed Page 82
3rd para++

3rd paragraph says figure 4-5 has sample output -- it does not, it contains a uml diagram.

the 'paw' insert below 3rd paragraph says as_you-with_entity.xml file is contained in examples download; -- not true.

many of examples in this book are not contained in the examples download.

gary bello 
Printed Page 127
Line 10

The book source code says:

System.err.println("Usage: java javaxmls.DOMModuleChecker " +
"org.w3c.dom.DOMImplementation impl class");

The correct code should be:

System.err.println("Usage: java javaxmls.DOMModuleChecker " +
"org.apache.xerces.dom.DOMImplementationImpl");

Anonymous 
Printed Page 165
java command example under Changing the Parser Implementation

The command line example having -Djavax.xml.transform.TransformerFactory should be changed to -
Djavax.xml.parsers.SAXParserFactory.

Anonymous 
Printed Page 165
Section "Changing the Parser Implementation"

In the command:

java -Djavax.xml.transform.TransformerFactory=org.apache.xerces.parsers.SAXParser
javaxml3.SAXTester ibm-jaxp-article.xml

both the property name and value are wrong. The entire command should be:

java -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
javaxml3.SAXTester ibm-jaxp-article.xml

Anonymous 
Printed Page 276
NegateFilter, OrFiler, and AndFilter Sections

org.jdom.filter.NegateFilter, org.jdom.filter.OrFilter, and org.jdom.filter.OrFilter are all protected
methods and cannot be directly instantiated.

The three examples should really be along these lines:

// Create filters that inherit from AbstractFilter
// to get "negate", "and", and "or" methods.
AbstractFilter filter1 = new ElementFilter("person");
AbstractFilter filter2 = new ElementFilter( Namespace.getNamespace("http://jitjat.com/fake") );

// negation of a filter
Filter notFilter1 = filter1.negate();

// or'ing two filters
Filter filter1OrFilter2 = filter1.or( filter2 );

// and'ing of two filters
Filter filter1AndFilter2 = filter1.and( filter2 );

Anonymous 
Printed Page 289
2nd Paragraph

The default factory class is org.jdom.DocumentFactory. Should be org.dom4j.DocumentFactory.

Also on same page 3rd paragraph: For example, org.jdom.util.IndexedDocumentFactory creates instances of
org.dom4j.util.IndexedElement instead of DefaultElement. This should be
org.dom4j.util.IndexedDocumentFactory.

Anonymous 
Printed Page 291
last paragraph

"SAXOutputer" must in fact be "SAXOutputter" in the last sentence of the page.

Anonymous 
Printed Page 295
2nd paragraph of the "Document Output" subsection

While the text states that an XMLWriter writes XML objects to either a java.io.Writer or a
java.io.InputStream, it in fact writes to a java.io.Writer or a java.io.OutputStream.

Anonymous 
Printed Page 296
3rd paragraph from the bottom

A newline is output between the XML declaration and first node of the document if the
newLineAfterDeclaration property is true (rather than false, as stated in the text).

Anonymous 
Printed Page 303
example code at the bottom of the page

Perhaps it might be nicer if the class "NamesapceChangingVisitor" was called "NamespaceChangingVisitor"
instead.

Anonymous 
Printed Page 305
Example 10-3

The variable "out" must be declared as a "DocumentResult", not as a "JDOMResult".

Anonymous 
Printed Page 310
2nd paragraph

The sentence

"Instead, you marshall XML into Java objects and unmarshall Java objects into an XML document."

probably should read

"Instead, you unmarshal XML into Java objects and marshal Java objects into an XML document."

(i.e. 'marshal' and 'unmarshal' have to be interchanged, and they are spelled with one 'l' at the end
only).

Anonymous 
Printed Page 331
Paragraph underneath Example 11-8

"javax.xml.bind.annotations.XmlAccessType" must be "javax.xml.bind.annotation.XmlAccessType".

Anonymous 
Printed Page 438
Section "Unicode Normalization Checking"

The URI: http://xml.org/sax/features/validation

is wrong, should be:

URI: http://xml.org/sax/features/unicode-normalization-checking

Anonymous