【发布时间】:2010-10-17 20:10:41
【问题描述】:
鉴于这种简化的数据格式:
<a>
<b>
<c>C1</c>
<d>D1</d>
<e>E1</e>
<f>don't select this one</f>
</b>
<b>
<c>C2</c>
<d>D2</d>
<e>E1</e>
<g>don't select me</g>
</b>
<c>not this one</c>
<d>nor this one</d>
<e>definitely not this one</e>
</a>
您将如何选择所有Cs、Ds 和Es 作为B 元素的子元素?
基本上是这样的:
a/b/(c|d|e)
在我自己的情况下,不仅仅是a/b/,导致选择C、D、E 节点的查询实际上非常复杂,所以我想避免这样做:
a/b/c|a/b/d|a/b/e
这可能吗?
【问题讨论】: