标签: java xml string parsing
我有一个持有XML文档的JAVA字符串。什么是解析字符串并提取值的最简单方法,在本例中为“abc”,如下所示:
<...> <book>abc</book> </...>
由于
答案 0 :(得分:1)
尝试使用以下链接的代码:
How to parse a String containing XML in Java and retrieve the value of the root node? http://www.java2s.com/Code/Java/XML/ParseanXMLstringUsingDOMandaStringReader.htm
How to parse a String containing XML in Java and retrieve the value of the root node?
http://www.java2s.com/Code/Java/XML/ParseanXMLstringUsingDOMandaStringReader.htm