This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Web Services and the fly likes JAXB Parser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "JAXB Parser" Watch "JAXB Parser" New topic
Author

JAXB Parser

Vijay Kumar
Ranch Hand

Joined: Jul 24, 2003
Posts: 260
Which parser is used by JAXB to Marshalling & unMarshalling
Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42031
    
  64
I don't think JAXB comes with its own parser, so it would rely on the one JAXP supplies. Depending on the JRE version, that could be Crimson or Xerces.


Ping & DNS - my free Android networking tools app
Vijay Kumar
Ranch Hand

Joined: Jul 24, 2003
Posts: 260
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
Vijay Kumar
Ranch Hand

Joined: Jul 24, 2003
Posts: 260
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
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42031
    
  64
Why would you want to specify which parser JAXB should use? Note that a parser can only read XML, not generate it.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
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".

Kohsuke Kawaguchi's Blog
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 ]
 
GeeCON Prague 2014
 
subject: JAXB Parser