| Example 22 Previous Next |
| //BBB[position() mod 2 = 0 ] |
|---|
| Select even BBB elements |
|
<AAA> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <CCC/> <CCC/> <CCC/> </AAA> |
| Open the example in XLab. | Tree view (PNG) |
| //BBB[ position() = floor(last() div 2 + 0.5) or position() = ceiling(last() div 2 + 0.5) ] |
|---|
| Select middle BBB element(s) |
|
<AAA> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <CCC/> <CCC/> <CCC/> </AAA> |
| Open the example in XLab. | Tree view (PNG) |
| //CCC[ position() = floor(last() div 2 + 0.5) or position() = ceiling(last() div 2 + 0.5) ] |
|---|
| Select middle CCC element(s) |
|
<AAA> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <BBB/> <CCC/> <CCC/> <CCC/> </AAA> |
| Open the example in XLab. | Tree view (PNG) |