How Can i configure JAXP's SAXParserFactory class to use IBM's parser with ? Which parsers other than Xerces provide plugablity into JAXP?
Thanx, Amit
------------------ Sun Certified Java Programmer for Java 2 Programming
SCJP2
Ajith Kallambella
Sheriff
Joined: Mar 17, 2000
Posts: 5781
posted
0
The System class maintains a set of properties, key/value pairs, that define traits or attributes of the current working environment. When the runtime system first starts up, the system properties are initialized to contain information about the runtime environment. including information about the current user, the current version of the Java runtime, and even the character used to separate components of a filename. Checkout Java Tutorial section on System properties for an excellent introduction to how and when the properites can be used. JAXP uses "org.xml.sax.parser" as key for SAX Parser class name. You can use the System properties to tell JAXP to use a specific SAX/DOM parser. You can either tweak the properties file externally or inside your program. Here's an example - System.setProperty ("org.xml.sax.parser","<QualifiedpathToYourParser>"); Hope that helps! ------------------ Ajith Kallambella M. Sun Certified Programmer for the Java�2 Platform. IBM Certified Developer - XML and Related Technologies, V1.
Open Group Certified Master IT Architect.
Sun Certified Architect(SCEA).
Amit Ganatra
Greenhorn
Joined: Jun 19, 2001
Posts: 19
posted
0
Originally posted by Ajith Kallambella: The System class maintains a set of properties, key/value pairs, that define traits or attributes of the current working environment. When the runtime system first starts up, the system properties are initialized to contain information about the runtime environment. including information about the current user, the current version of the Java runtime, and even the character used to separate components of a filename. Checkout Java Tutorial section on System properties for an excellent introduction to how and when the properites can be used. JAXP uses "org.xml.sax.parser" as key for SAX Parser class name. You can use the System properties to tell JAXP to use a specific SAX/DOM parser. You can either tweak the properties file externally or inside your program. Here's an example - [b]System.setProperty ("org.xml.sax.parser","<QualifiedpathToYourParser>"); Hope that helps! [/B]
Amit Ganatra
Greenhorn
Joined: Jun 19, 2001
Posts: 19
posted
0
Hi Ajith, The solution which u have mentioned works. I am reading a book which mentioned abt plugablity of Parsers into Jaxp by using Factories i.e. each vendor specific Parser that u wanna plug into JAXP should have a special Factory class and i need to have a special JAXP pacakage in that vendor specific parser....and as of now only xerces has that JAXP plugablity. I never this soln existed. Where can I find the documentation for this plugablity options. I just wanna preserve it for future use. Thanx for ur help.. amit
Originally posted by Ajith Kallambella: The System class maintains a set of properties, key/value pairs, that define traits or attributes of the current working environment. When the runtime system first starts up, the system properties are initialized to contain information about the runtime environment. including information about the current user, the current version of the Java runtime, and even the character used to separate components of a filename. Checkout Java Tutorial section on System properties for an excellent introduction to how and when the properites can be used. JAXP uses "org.xml.sax.parser" as key for SAX Parser class name. You can use the System properties to tell JAXP to use a specific SAX/DOM parser. You can either tweak the properties file externally or inside your program. Here's an example - [b]System.setProperty ("org.xml.sax.parser","<QualifiedpathToYourParser>"); Hope that helps! [/B]