Link to home
Start Free TrialLog in
Avatar of lasutton
lasutton

asked on

What is the best (and easiest) XML parser to use for a Java class that will be deployed using jdk1.5.0_12.

What is the best (and easiest) XML parser to use for a Java class that will be deployed using jdk1.5.0_12.  It will be deployed under a JBoss environment but should preferably not be server specific.
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

(both exist in Java 5)
Avatar of lasutton
lasutton

ASKER

Can you point me to any sample classes that use either of these parsers?  i.e.: a class that reads one or two elements from an XML document (or String included in the class that is moved into the XML document).
Are you looking for an actual parser or for an easy-to-use API to parse an XML document? If you are looking for the latter, I would suggest using JDOM, an alternative to DOM API you would have to use if you were to go with JDK XML parsing API.

http://www.jdom.org/

JDOM's mission is to make API for parsing, traversing and building XML documents simpler that that afforded by W3C DOM API.

Some JDOM usage examples:

http://www.cafeconleche.org/books/xmljava/examples/14/index.html


Michael
What I am looking for at this point is an easy way to traverse and search for specific elements and attributes in an XML document that is less than 16k in size.  Basically I need to be able to read the document as if I would try to look for records in a database with an index with multiple keys.
...something along the lines of xPath type search capabilities but that can be built within the Java class.
ASKER CERTIFIED SOLUTION
Avatar of msmolyak
msmolyak

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial