How to deserialize Java objects from XML?

后端 未结 5 743
暗喜
暗喜 2021-01-16 08:01

I\'m sure this might have been discussed at length or answered before, however I need a bit more information on the best approach for my situation...

Problem

5条回答
  •  -上瘾入骨i
    2021-01-16 08:32

    Use XSLT to transform the large XML files into a local domain model that is mapped to java objets with JAXB.

    Start with the JDK 5+ built in XML libraries (unless you absolutely need XSLT 2.0, in which case use Saxon)

    Don't focus on relative performance of SAX/DOM, focus on learning how to write XPath expressions and use XSLT, and then worry about performance later if and only if you find it to be a problem.

    The Eclipse XML editors are decent, but if you can afford it, spring for Oxygen XML, which will let you do XPath evaluation in realtime.

提交回复
热议问题