1
我想有一个xpath表达式来获得一个节点的所有即时和非叶儿童。Xpath表达式来获得即时和非叶儿童
当我运行这样的XML树的表达:
<root>
<attribute1>a</attribute1>
<attribute2>b</attribute2>
<attribute3>c</attribute3>
<ElementA>
<ElementB>
<ElementC>AC</ElementC>
</ElementB>
</ElementA>
<ElementX>
<ElementB1>
<ElementC1>C1</ElementC1>
</ElementB1>
</ElementX>
<Other>
<ElementB2>B2</ElementB2>
</Other>
<NewOne>
<ElementB3>
<ElementC3>
<ElementC4>C4</ElementC4>
</ElementC3>
</ElementB3>
</NewOne>
</root>
我应该得到ElementA,ElementX,其他,NewOne。
Thans寻求帮助。
你为什么标记此【JAVA]? – BoltClock
这是一个错误:那是因为我使用java程序来浏览xml树。 – VRTHT