How can i parse the following XML using JDOM

前端 未结 3 1639
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-17 02:47

I have an XML document as follows:




  
    Wha         


        
相关标签:
3条回答
  • 2021-01-17 03:20

    Use Element.getChildren(String) to get all of the question tags and loop through that List - calling getChildren(String) to get all of the answers, or getChild(String) if there can be only one child element.

    0 讨论(0)
  • 2021-01-17 03:29

    Article

    In the light of previous related questions, I'd like to repeat and stress the advice of others (like JB Nizet commented on this question):

    Learn Java, learn XML, pick the tools and API's you need for your project and learn to use those too. If at one point you get into trouble, everybody here will be happy to help you out debugging your code.

    I'm aware that this may seem harsh but it gets to the point where your program gets built by StackOverflow users and not yourself.

    That being said, the link at the top of this answer leads to a tutorial on using JDOM to traverse your XML.

    0 讨论(0)
  • 2021-01-17 03:37

    first that you need use is XSD to validate the XML.

    0 讨论(0)
提交回复
热议问题