Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting the org.xml.sax.driver

Status
Not open for further replies.

jsulman

Programmer
Jun 14, 2001
85
US
How do I set the org.xml.sax.driver system property to create an
createXMLReader? I know it can be done on the compiler command line.
However, I would like to do it in my program.

I have tried the command System.setProperty
("org.xml.sax.driver","org.xml.sax.helpers.ParserFactory"); but it does
not work. I get the error:

java.lang.IllegalAccessException: org.xml.sax.helpers.ParserFactory
at
org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:121)
at
org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:96)
at cms.xml.xmljava1.Example1.main(Example1.java:81)

I suspect I am using the wrong SAX Parser.

Anybody offer any help!!!

Thanks in Advance

Jeff Sulman
 
You can do it explicitly in your code so long as
you make sure to lug around the appropriate driver.

XMLReader xr = new org.apache.xerces.SAXDriver();

Then register all the usual handler stuff etc.........
 
Also I just read this at javasoft

SAXParserFactory factory
= SAXParserFactory.newInstance();
factory.setValidating(validating);
parser = factory.newSAXParser();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top