The*_*111 5 java xml parsing xml-parsing xmlstreamreader
如果我有一个 XML 元素,例如:
<title>this is a title</title>
Run Code Online (Sandbox Code Playgroud)
使用 XMLStreamReader 很容易获得文本。getElementText()
. 但是,如果遇到这样的元素,我无法弄清楚如何获取文本:
<title>this is a <othertag>title with another</othertag> tag inside of it</title>
Run Code Online (Sandbox Code Playgroud)
我什至不确定那是否是有效的 XML,但它似乎通过了我试过的 W3C 验证器。根据API 文档,getElementText()
如果您要在START_ELEMENT
内部遇到另一个事件,则不能使用来获取文本。那么...可以使用?
归档时间: |
|
查看次数: |
6402 次 |
最近记录: |