<?xml version="1.2"?>
Now run the Java SAX viewer program on the modified XML document.
Your output should be similar to that shown here:
C:\javaxml2\build>java javaxml2.SAXTreeViewer ..\ch03\xml\contents.xml
**Parsing Error**
Line: 1
URI: file:///C:/javaxml2/ch03/xml/contents.xml
Message: XML version "1.2" is not supported.
org.xml.sax.SAXException: Error encountered
When an XML parser is operating upon a document that reports a
version of XML greater than that supported by the parser, a nonfatal
error is reported, in accordance with the XML 1.0 specification. This
tells an application that newer features expected to be utilized by
the document may not be available within the parser and the version
that it supports. Because parsing continues, this is a nonfatal
error. However, because it signifies a major impact on the document
(such as newer syntax possibly generating subsequent errors), it is
considered more important than a warning. This is why the
error( ) method is invoked and triggers the error
message and parsing halt in the example program.