Using Java to parse XML

后端 未结 7 770
忘了有多久
忘了有多久 2020-12-21 07:23

I have made a PHP script that parses an XML file. This is not easy to use and I wanted to implement it in Java.

Inside the first element there are various count of

7条回答
  •  心在旅途
    2020-12-21 07:52

    I agree what has been already posted about not implementing parse functions yourself.

    Instead of DOM/SAX/STAX parsers though, I would suggest using JDOM or XOM, which are external libraries.

    Related discussions:

    • What Java XML library do you recommend (to replace dom4j)?
    • Should I still be using JDOM with Java 5 or 6?

    My gut feeling is that jdom is the one most java developers use. Some use dom4j, some xom, some others, but hardly anybody implements these parsing functions themselves.

提交回复
热议问题