How do you change parsers when using JAXP?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   neal_ravindran
Posted On:   Wednesday, July 31, 2002 08:54 PM

Say I have an application(with a main function, that is) that uses the SAX API to echo out the elements.

1)How can I change parsers(from say 'xerces' to some other one) when using SAX API in JAXP?

2)Same qn when using the DOM API.

Re: How do you change parsers when using JAXP?

Posted By:   neal_ravindran  
Posted On:   Thursday, August 1, 2002 11:05 AM

I found answer in the JAXP tutorial(part of sun webservices tutorial)..

Set the property 'javax.xml.parsers.SAXParserFactory' from command line like in the following example:-

java   -Djavax.xml.parsers.SAXParserFactory=yourFactoryHere Echo01.java someXmlFile.xml



The factory name you specify must be a fully qualified class name (all package prefixes included)

About | Sitemap | Contact