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
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.
StAX's javax.xml.stream.XMLInputFactory has its own set of system properties that influence its behavior but none of them specify a "parser".
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 ]