【发布时间】:2017-04-15 01:20:38
【问题描述】:
我想在其中获取与属性 name="Fire" 对应的字符的 XML 文件,即 Tree:
<Troupe name="Ring">Hat</Troupe>
<Troupe name="Fire">Tree</Troupe>
<Troupe name="bank">Next</Troupe>
使用 StAX:
XmlStreamConstant.Start_Element:
//Parse Troupe found matching attribute name whose value is Fire
XmlStreamConstant.Characters:
//Fetch the character Tree corresponding to attribute name Fire.
StAX 是否提供了一种简单的方法来获取属性值与特定字符匹配的字符?
【问题讨论】: