【发布时间】:2018-02-03 10:48:52
【问题描述】:
我想使用 Java 或 Scala 获取 XML 中所有节点的 XPath 吗?
<foo>
<foo1>Foo Test 1</foo1>
<foo2>
<another1>
<test10>This is a duplicate</test10>
</another1>
</foo2>
<foo2>
<another1>
<test1>Foo Test 2</test1>
</another1>
</foo2>
<foo3>Foo Test 3</foo3>
<foo4>Foo Test 4</foo4>
</foo>
输出:
foo
foo/foo2/
/foo/foo2/another1/
【问题讨论】: