Parsing XML file with DOM (Java)

后端 未结 3 1801
情书的邮戳
情书的邮戳 2021-01-24 21:02

I want to parse the following url: http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=nucleotide&id=224589801

As a result I came up with the following met

3条回答
  •  一个人的身影
    2021-01-24 21:37

    1. Text value that is surrounded by XML tag are also considered as Node in DOM. That's why you have to get the text Node before getting the value. If you try to count the number of node in an , you will see that whenever there is a text, there is a node.

    2. XOM has more intuitive interface but it doesn't have org.w3c.dom.* interface.

    If you want to use the build-in parser, you should look at http://www.java-samples.com/showtutorial.php?tutorialid=152

    The DOMParser you tried to use are propriety and it's not portable.

提交回复
热议问题