Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best StAX Implementation [closed]

My quick search reveals the reference implementation (http://stax.codehaus.org), the Woodstox implementation (http://woodstox.codehaus.org), and Sun's SJSXP implementation (https://sjsxp.dev.java.net/).

Please comment on the relative merits of these, and fill me in on any other implementations I should consider.

like image 533
Jeff C Avatar asked Sep 23 '08 14:09

Jeff C


People also ask

What are the main Streaming API for XML StAX cursor interfaces?

The cursor API has two main interfaces: XMLStreamReader for parsing XML and XMLStreamWriter for generating XML.

Can we create an XML document using StAX parser?

Java StAX Parser - Create XML Document.

What is the use of StAX API?

The StAX API exposes methods for iterative, event-based processing of XML documents. XML documents are treated as a filtered series of events, and infoset states can be stored in a procedural fashion. Moreover, unlike SAX, the StAX API is bidirectional, enabling both reading and writing of XML documents.

What is StAX parsing?

StAX is a Java-based API to parse XML document in a similar way as SAX parser does. But there are two major difference between the two APIs − StAX is a PULL API, whereas SAX is a PUSH API. It means in case of StAX parser, a client application needs to ask the StAX parser to get information from XML whenever it needs.


2 Answers

Woodstox wins every time for me. It's not just performance, either - sjsxp is twitchy and overly pedantic, woodstox just gets on with it.

like image 188
skaffman Avatar answered Oct 05 '22 00:10

skaffman


Interesting to note that:

SJSXP performance is consistently faster than BEA, Oracle and RI for all of the documents described here in this study. However, it lags behind Woodstox and XPP3 in some document sizes and in the best cases, exhibits similar performance compared to these two parsers.

Article from Sun: Streaming APIs for XML parsers

like image 21
prakash Avatar answered Oct 05 '22 00:10

prakash