Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个类似于
<A> <B> <C1> <D> some text 1 </D> </C1> <C2> <D> some text 2 </D> </C2> </B> </A>
我想使用通配符来获取所有 D 元素节点的文本。我试过 /A/B/*/D/text() 但它似乎不起作用。帮助表示赞赏。
使用//运算符。它将为您提供D文档中的所有元素。
//
D
//D/text()