3

Reading this discussion

Aalto is by far fastest of the three, especially for parsing. It is commonly 50% - 100% faster than either Woodstox or SJSXP. One downside is that it does not handle DTDs (and thereby not external entities; it handles pre-defined and character entities).

it seems that Aalto is the recommended way to read/write xml with jackson. However on jackson-dataformat-xml page it recommends using Woodstox, which has not been updated for some time.

So what is the best way forward? Woodstox or Aalto?

Community
  • 1
  • 1
husayt
  • 14,553
  • 8
  • 53
  • 81
  • 2
    One small note on Woodstox releases: part of reason for few releases is that it is very mature, complete and bug-free. "If it ain't broke, don't fix it". But there has been a new release (4.3.0) to add one feature that was missing, ability to limit expansion of parsed entities (needed to protect against certain forms of denial-of-service attacks using XML parsed entities) – StaxMan Mar 28 '14 at 22:34

1 Answers1

3

I think that Woodstox is the safest choice for correct operation, given its wide functionality and being de facto Stax standard implementation -- most Java XML/Soap frameworks use Woodstox. So if you just want least hassle all around, it is a good choice.

But Aalto is significantly faster, and its features set is perfectly fine for Jackson XML module: DTD processing is not needed for JAXB-style data-binding.

So I would say that this comes back to how much you value performance (Aalto) and how much simple no-hassle "it just works with no problems whatsoever" (Woodstox). That is how I would choose myself, if I was developing system myself.

Besides, switching from one to the other is trivially easy: so one possibility is to try Aalto; and only if you face an issue (FWIW, there are no reported issue with Aalto/Jackson, as per issue tracker -- these are hypothetical issues).

StaxMan
  • 113,358
  • 34
  • 211
  • 239