18

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.

Jeff C
  • 445
  • 4
  • 10

4 Answers4

17

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

skaffman
  • 398,947
  • 96
  • 818
  • 769
5

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

Jonas
  • 121,568
  • 97
  • 310
  • 388
prakash
  • 58,901
  • 25
  • 93
  • 115
1

http://javolution.org/ has a good StAX implementation

Javamann
  • 2,882
  • 2
  • 25
  • 22
1

Comment on Javolution: No it's not Stax implementation. It does implement an API similar to Stax, but because of Javolution's avoidance of Strings etc, it can not be source compatible.

Either way, their implementation is not particularly good -- it's not faster, and it is less fully-featured, doesn't detect xml problems (like duplicate attributes), won't process entities or such. So I don't see much reason using it, unless you use Javolution classes for everything.

  • +1 for pointing out that the Javolution implementation is *not* source compatible. However.. -0.5 for not backing up your claim ("not particularly good", "not faster") with facts. :/ – Marco Apr 07 '13 at 12:46