forked from fengbird/JavaWebCoreNote
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample22.html
More file actions
149 lines (144 loc) · 10.5 KB
/
example22.html
File metadata and controls
149 lines (144 loc) · 10.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../CSS/tutorial.css">
<title>XPath Tutorial</title>
<link rel="index" href="index.html">
<link rel="previous" href="example21.html">
<link rel="next" href="example1.html">
</head>
<body>
<table xmlns="http://www.w3.org/1999/xhtml" width="100%">
<tr>
<td><span class="mediumText"><b>>> English <<</b> | <a class="naviBlack" target="_self" href="../Output_cze/example22.html">česky</a> | <a class="naviBlack" target="_self" href="../Output_dut/example22.html">Nederlands</a> | <a class="naviBlack" target="_self" href="../Output_fre/example22.html">Français</a> | <a class="naviBlack" target="_self" href="../Output_spa/example22.html">Español</a> | <a class="naviBlack" target="_self" href="../Output_rus/example22.html">По-русски</a> | <a class="naviBlack" target="_self" href="../Output_ger/example22.html">Deutsch</a> | <a class="naviBlack" target="_self" href="../Output_chi/example22.html">中文</a> | <a class="naviBlack" target="_self" href="../Output_ita/example22.html">Italiano</a></span></td>
<td style="text-align:right"><span class="mediumText"><a class="naviBlack" target="_top" href="http://www.zvon.org">ZVON</a>
>
<a class="naviBlack" target="_top" href="http://www.zvon.org/index.php?nav_id=tutorials">Tutorials</a>
>
<b>XPath Tutorial</b></span></td>
</tr>
</table>
<table xmlns="http://www.w3.org/1999/xhtml" class="bar" width="750px" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="naviBlue"><a class="naviWhite" target="_top" href="../General/examples.html">Intro</a>
/
<a class="naviWhite" target="_top" href="http://zvon.org/search.php">Search</a>
/
<a class="naviWhite" target="_top" href="http://www.zvon.org"> ZVON </a></td>
</tr>
</table>
<table class="hangingMenu" border="0" cellpadding="1" cellspacing="0" width="100%">
<tr>
<td><b>>> Example 22 <<</b>
|
<a class="naviBlack" href="example21.html">Prev</a>
|
<a class="naviBlack" href="example1.html">Next</a></td>
</tr>
</table><br><div class="description">The div operator performs floating-point division, the mod operator returns the remainder from a truncating division. The
floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is
an integer.The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument
and that is an integer.
</div>
<div><a name="b9b1c29c33"></a>
</div>
<table border="1" cellpadding="5" width="85%">
<tr>
<th>//BBB[position() mod 2 = 0 ]</th>
</tr>
<tr>
<td>Select even BBB elements</td>
</tr>
<tr>
<td class="code">
<br> <<span class="element">AAA</span>>
<br> <<span class="element">BBB</span>/>
<br> <<span class="elementOn">BBB</span>/>
<br> <<span class="element">BBB</span>/>
<br> <<span class="elementOn">BBB</span>/>
<br> <<span class="element">BBB</span>/>
<br> <<span class="elementOn">BBB</span>/>
<br> <<span class="element">BBB</span>/>
<br> <<span class="elementOn">BBB</span>/>
<br> <<span class="element">CCC</span>/>
<br> <<span class="element">CCC</span>/>
<br> <<span class="element">CCC</span>/>
<br> </<span class="element">AAA</span>>
</td>
</tr>
<tr>
<td><a target="_top" href="http://www.zvon.org:9001/saxon/cgi-bin/XLab/XML/xpatut_22.html?stylesheetFile=XSLT/xpath.xslt&value=//BBB[position()%20mod%202%20=%200%20]&lang=eng">Open the example in XLab.</a> | <a href="example22_0_png.html">Tree view (JPG)</a></td>
</tr>
</table>
<div><a name="b9b1c29c35"></a>
</div>
<table border="1" cellpadding="5" width="85%">
<tr>
<th>//BBB[ position() = floor(last() div 2 + 0.5) or position() = ceiling(last() div 2 + 0.5) ]</th>
</tr>
<tr>
<td>Select middle BBB element(s)</td>
</tr>
<tr>
<td class="code">
<br> <<span class="element">AAA</span>>
<br> <<span class="element">BBB</span>/>
<br> <<span class="element">BBB</span>/>
<br> <<span class="element">BBB</span>/>
<br> <<span class="elementOn">BBB</span>/>
<br> <<span class="elementOn">BBB</span>/>
<br> <<span class="element">BBB</span>/>
<br> <<span class="element">BBB</span>/>
<br> <<span class="element">BBB</span>/>
<br> <<span class="element">CCC</span>/>
<br> <<span class="element">CCC</span>/>
<br> <<span class="element">CCC</span>/>
<br> </<span class="element">AAA</span>>
</td>
</tr>
<tr>
<td><a target="_top" href="http://www.zvon.org:9001/saxon/cgi-bin/XLab/XML/xpatut_22.html?stylesheetFile=XSLT/xpath.xslt&value=//BBB[%20position()%20=%20floor(last()%20div%202%20+%200.5)%20or%20position()%20=%20ceiling(last()%20div%202%20+%200.5)%20]&lang=eng">Open the example in XLab.</a> | <a href="example22_1_png.html">Tree view (JPG)</a></td>
</tr>
</table>
<div><a name="b9b1c29c37"></a>
</div>
<table border="1" cellpadding="5" width="85%">
<tr>
<th>//CCC[ position() = floor(last() div 2 + 0.5) or position() = ceiling(last() div 2 + 0.5) ]</th>
</tr>
<tr>
<td>Select middle CCC element(s)</td>
</tr>
<tr>
<td class="code">
<br> <<span class="element">AAA</span>>
<br> <<span class="element">BBB</span>/>
<br> <<span class="element">BBB</span>/>
<br> <<span class="element">BBB</span>/>
<br> <<span class="element">BBB</span>/>
<br> <<span class="element">BBB</span>/>
<br> <<span class="element">BBB</span>/>
<br> <<span class="element">BBB</span>/>
<br> <<span class="element">BBB</span>/>
<br> <<span class="element">CCC</span>/>
<br> <<span class="elementOn">CCC</span>/>
<br> <<span class="element">CCC</span>/>
<br> </<span class="element">AAA</span>>
</td>
</tr>
<tr>
<td><a target="_top" href="http://www.zvon.org:9001/saxon/cgi-bin/XLab/XML/xpatut_22.html?stylesheetFile=XSLT/xpath.xslt&value=//CCC[%20position()%20=%20floor(last()%20div%202%20+%200.5)%20or%20position()%20=%20ceiling(last()%20div%202%20+%200.5)%20]&lang=eng">Open the example in XLab.</a> | <a href="example22_2_png.html">Tree view (JPG)</a></td>
</tr>
</table>
<div><br><br><br><div>_____________________________________________</div>
<div><a class="smallBlackLink" target="_top" href="http://zvon.org/php/Search/codes.php">Reference Search</a> |
<a class="smallBlackLink" target="_top" href="http://zvon.org/index.php?nav_id=zvonindex">Sitemap</a> |
<a class="smallBlackLink" target="_top" href="http://zvon.org/index.php?nav_id=173">XML Glossary</a>
<a class="smallBlackLink" target="_top" href="http://www.zvon.org">ZVON</a> |
<a class="smallBlackLink" target="_top" href="http://www.systinet.com">Systinet</a></div>
</div>
<!--partners-->
<!--advertisement-->
</body>
</html>