| English | česky | Nederlands | Français | Español | По-русски | Deutsch | >> 中文 << | Italiano | Polski | ZVON > Tutorials > XPath Tutorial |
| 介绍 / 搜索 / ZVON |
| >> 实例 22 << | 前页 | 后页 |
| //BBB[position() mod 2 = 0 ] |
|---|
| 选择偶数位置的BBB元素 |
|
<AAA> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <CCC/> <CCC/> <CCC/> </AAA> |
| 在XLab中打开实例 | 树视图 (JPG) |
| //BBB[ position() = floor(last() div 2 + 0.5) or position() = ceiling(last() div 2 + 0.5) ] |
|---|
| 选择中间的BBB元素 |
|
<AAA> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <CCC/> <CCC/> <CCC/> </AAA> |
| 在XLab中打开实例 | 树视图 (JPG) |
| //CCC[ position() = floor(last() div 2 + 0.5) or position() = ceiling(last() div 2 + 0.5) ] |
|---|
| 选择中间的CCC元素 |
|
<AAA> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <CCC/> <CCC/> <CCC/> </AAA> |
| 在XLab中打开实例 | 树视图 (JPG) |