Hi,
according to page 489 dear authors wrote:
Code:
XMLReader reader = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
reader.setContentHandler(this);
reader.parse(filename);
I don't get why authors wrote imports (two Java classes):
Code:
import javax.xml.parsers.SAXParserFactory;
import javax.xml.parsers.SAXParser;
and then did not use them, confusing thing for me. Never mind.
I think this can be done simpler without outside SAX Parser (xerces) configuration (with CLASSPATH variable settings) by this code (instead of above):
Code:
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser reader = factory.newSAXParser();
reader.parse(filename, this);
Of course above imports getting necessary now.
Kind regards