Hi:
The following two line code was from xml4j-3-2-0/samples/sax/sax2count.java (from IBM site)
String parserName="org.apache.xerces.parsers.SAXParser"
XMLReader parser = (XMLReader)Class.forName(parserName).newInstance();///??
Class.forName(parserName) return object of org.apache.xerces.parsers.SAXParser
I do not see any newInstance() method belong to org.apache.xerces.parsers.SAXParser ot XMLReader///!!
the only two newInstance() methods can be found at following:
newInstance() - Static method in class javax.xml.parsers.SAXParserFactory
Obtain a new instance of a SAXParserFactory.
newSAXParser() - Method in class javax.xml.parsers.SAXParserFactory
Creates a new instance of a SAXParser using the currently configured factory parameters.
class javax.xml.parsers.SAXParserFactory was directly extended from java.lang.Object
Somebody please help me, how could newInstance() be called in statement of XMLReader parser = (XMLReader)Class.forName(parserName).newInstance()
Thank you for help!
Tom Gong