Thanks Ulf Dittmer but in JAXB tutorial JAXB a StAX, which provides a standard, bidirectional pull parser interface for streaming XML processing. Is there any way through which I can define which Parser should use for marshaling & unmarshalling. thanks
Joined: Jul 24, 2003
Hi,All There is StaX API is defined in JWS Tutorials (V1.6). Is this API used to parse & update the XML
Thanks Vijay Kumar
Joined: Mar 22, 2005
Why would you want to specify which parser JAXB should use? Note that a parser can only read XML, not generate it.
StAX: "Streaming API for XML" - that means it is an API for reading and writing XML streams. StAX may very well do it's own "parsing" (rather than relying on a pre-existing parser) - or are you trying control the StAX implementation that is being used? If so why?
The SAX parser returned by the javax.xml.parsers.SAXParserFactory is controlled by the "javax.xml.parsers.SAXParserFactory" system property but code can easily bypass that by looking for a specific parser implementation.
I'm also not aware that JAXB was ever required to use any XML manipulation technology in particular. There always has been the suggestion that JAXB would use something like SAX or StAX in order to maximize speed and minimize the memory footprint but the implementation was always free to do its "own thing".
This release is also the fastest JAXB RI release ever. Both the unmarshaller and marshaller were implemented pretty much from scratch for 2.0. The marshaller in particular has a brand-new algorithm highly optimized for UTF-8. It's so fast that at one point (maybe it still is) faster then our own FastInfoset.
[ August 02, 2007: Message edited by: Peer Reynders ]