Hello,
which is a good Java API for working with XML (both DOM and SAX approaches)? Is JAXP a good choice, or is it deprecated? And, what good tutorial on the suggested API do you know?
Thanks.
Hello,
which is a good Java API for working with XML (both DOM and SAX approaches)? Is JAXP a good choice, or is it deprecated? And, what good tutorial on the suggested API do you know?
Thanks.
I like JDOM, http://jdom.org, which is especially nice to use for DOM and XPath. It bases its SAX on the JAXP classes.
JAXP isn't deprecated. It's a good choice for low-level XML operations in Java. As always, it depends on what you're wanting to do with the XML.
If you're just converting to and from Objects, try JAXB 2.0. If you need true low level XML manipulation (low-level parsing, XSLT transformation, XPath, etc) JAXP is a good choice.
Note that many Java XML solutions, including JAXB 2.0, StaX, and Jdom (IIRC) integrate nicely with JAXP, and can easily be passed to and from JAXP processors.
It ABSOLUTELY depends on what you're doing. Other people will throw in their favorite thing to work with, but this is a pointless question without clarification.
I recommend you Xerces. Support for both DOM and Sax, which is a library that has been trying for years. First Look at Xerces. If not enough or if you encounter problems look at other libraries.