【发布时间】:2015-01-30 06:31:31
【问题描述】:
使用 xpath 在父标签内查找特定标签:
示例输入:
<Table>
<Tbody>
<Row>
<cell><para> <ref> </ref> <ref> </ref> </para> </cell>
</Row>
<Row>
<cell><para> <a1> </a1><ref> </ref> </para> </cell>
</Row>
<Row>
<cell><para> <ref> </ref></para> </cell>
</Row>
<Row>
<cell><para> <b1> </b1></para> </cell>
</Row>
<Row>
<cell><para> <b1> </b1> <c1> </c1></para> </cell>
</Row>
<Row>
<cell><para> <ref> </ref> <c1> </c1></para> </cell>
</Row>
<Thead>
预期输出:
- cell1-para 它应该返回 0
- cell2-para 它应该返回 1
- cell3-para 它应该返回 0
- cell4-para 它应该返回 1
- cell5-para 它应该返回 2
- cell6-para 它应该返回 1
如何找出单元格内非 ref 标签的计数?
一个段落中可能有多个标签。名字可以是任何东西。但我们只需要单独检查 ref。
【问题讨论】:
标签: xpath