Java and XML, Third Edition by Brett McLaughlin, Justin Edelson The 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. 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 This page was updated July 8, 2008. UNCONFIRMED errors and comments from readers: {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 {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. [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"); {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. {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 [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 ); {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. (291) last paragraph; "SAXOutputer" must in fact be "SAXOutputter" in the last sentence of the 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. (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). (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). (303) example code at the bottom of the page; Perhaps it might be nicer if the class "NamesapceChangingVisitor" was called "NamespaceChangingVisitor" instead. {305} Example 10-3; The variable "out" must be declared as a "DocumentResult", not as a "JDOMResult". (331) Paragraph underneath Example 11-8; "javax.xml.bind.annotations.XmlAccessType" must be "javax.xml.bind.annotation.XmlAccessType". {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