1\input lxmlctx.mkiv
2
3\ctxlua{dofile("t:/sources/lxml-lpt.lua")}
4
5\startbuffer[xmltest]
6<?xml version=1.0?>
7
8<! this is a test file >
9
10<something id=1>
11 <x:whatever id=1.1>
12 <whocares id=1.1.1>
13 test a
14 <whocares>
15 <whocaresnot id=1.1.2>
16 test b
17 <whocaresnot>
18 <x:whatever>
19 <whatever id=2>
20 <whocares id=2.1>
21 test c
22 <whocares>
23 <whocaresnot id=2.2>
24 test d
25 <whocaresnot>
26 <whatever>
27 <whatever id=3>
28 test e
29 <whatever>
30 <whatever id=4 test="xxx">
31 <whocares id=4.1>
32 test f
33 <whocares>
34 <whocares id=4.2>
35 test g
36 <whocares>
37 <whatever>
38 <whatever id=5 test="xxx">
39 <whoknows id=5.1>
40 <whocares id=5.1.1>
41 test h
42 <whocares>
43 <whoknows>
44 <whoknows id=5.2>
45 <whocaresnot id=5.2.1>
46 test i
47 <whocaresnot>
48 <whoknows>
49 <whoknows id=5.3>
50 <whocares id=5.3.1>
51 test j
52 <whocares>
53 <whoknows>
54 <whatever>
55<something>
56\stopbuffer
57
58
59
60\setuplayout[width=middle,height=middle,header=1cm,footer=1cm,topspace=2cm,backspace=2cm]
61\setupbodyfont[10pt]
62
63\setfalse\xmllshowbuffer
64
65\starttext
66
67\xmllshow{(*:libraryfigurelibrary)*:figure*:label}
68\xmllshow{(*:libraryfigurelibrary)figure*:label}
69\xmllshow{(*:libraryfigurelibrary)figurelabel}
70\xmllshow{(*:libraryfigurelibrary)figure:*label}
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90\stoptext
91
92\xmllshow{*}
93\xmllshow{child::}
94\xmllshow{child::test}
95\xmllshow{testtest}
96\xmllshow{..theorysectionssectionexercises}
97\xmllshow{..trainingpracticalassignments}
98\xmllshow{....Outcome[position()=rootposition()]Conditioncommand(xml:answer:mc:condition)}
99
100
101
102
103
104\xmllshowbuffer{xmltest}{**}{id}
105\xmllshowbuffer{xmltest}{*}{id}
106\xmllshowbuffer{xmltest}{..}{id}
107\xmllshowbuffer{xmltest}{.}{id}
108\xmllshowbuffer{xmltest}{}{id}
109\xmllshowbuffer{xmltest}{}{id}
110
111\xmllshowbuffer{xmltest}{**}{id}
112\xmllshowbuffer{xmltest}{***}{id}
113\xmllshowbuffer{xmltest}{**.}{id}
114\xmllshowbuffer{xmltest}{**}{id}
115
116\xmllshowbuffer{xmltest}{*}{id}
117\xmllshowbuffer{xmltest}{**}{id}
118\xmllshowbuffer{xmltest}{*.}{id}
119\xmllshowbuffer{xmltest}{*}{id}
120
121\xmllshowbuffer{xmltest}{**}{id}
122\xmllshowbuffer{xmltest}{***}{id}
123\xmllshowbuffer{xmltest}{**.}{id}
124\xmllshowbuffer{xmltest}{**}{id}
125
126\xmllshowbuffer{xmltest}{*}{id}
127\xmllshowbuffer{xmltest}{**}{id}
128\xmllshowbuffer{xmltest}{*.}{id}
129\xmllshowbuffer{xmltest}{*}{id}
130
131\xmllshowbuffer{xmltest}{.}{id}
132\xmllshowbuffer{xmltest}{.*}{id}
133\xmllshowbuffer{xmltest}{..}{id}
134\xmllshowbuffer{xmltest}{.}{id}
135
136\xmllshowbuffer{xmltest}{..}{id}
137\xmllshowbuffer{xmltest}{..*}{id}
138\xmllshowbuffer{xmltest}{...}{id}
139\xmllshowbuffer{xmltest}{..}{id}
140
141\xmllshowbuffer{xmltest}{descendant::whocaresancestor::whoknows}{id}
142\xmllshowbuffer{xmltest}{descendant::whocaresancestor::whoknowsparent::}{id}
143\xmllshowbuffer{xmltest}{descendant::whocaresancestor::}{id}
144\xmllshowbuffer{xmltest}{child::somethingchild::whateverchild::whocares}{id}
145\xmllshowbuffer{xmltest}{child::somethingchild::whateverchild::whocareswhoknows}{id}
146\xmllshowbuffer{xmltest}{child::somethingchild::whateverchild::(whocareswhoknows)}{id}
147\xmllshowbuffer{xmltest}{child::somethingchild::whateverchild::!(whocareswhoknows)}{id}
148\xmllshowbuffer{xmltest}{child::somethingchild::whateverchild::(whocares)}{id}
149\xmllshowbuffer{xmltest}{child::somethingchild::whateverchild::(whocares)[position()>2]}{id}
150\xmllshowbuffer{xmltest}{child::somethingchild::whatever[position()>2][position()=1]}{id}
151\xmllshowbuffer{xmltest}{child::somethingchild::whatever[whocares][whocaresnot]}{id}
152\xmllshowbuffer{xmltest}{child::somethingchild::whatever[whocares][not(whocaresnot)]}{id}
153\xmllshowbuffer{xmltest}{child::somethingchild::whateverself::whatever}{id}
154\xmllshowbuffer{xmltest}{somethingwhatever}{id}
155\xmllshowbuffer{xmltest}{somethingwhatever}{id}
156\xmllshowbuffer{xmltest}{**whocares}{id}
157\xmllshowbuffer{xmltest}{whoknowswhocares}{id}
158\xmllshowbuffer{xmltest}{whoknows}{id}
159\xmllshowbuffer{xmltest}{whocares[contains(text(),f) or contains(text(),g)]}{id}
160\xmllshowbuffer{xmltest}{whocaresfirst()}{id}
161\xmllshowbuffer{xmltest}{whocareslast()}{id}
162\xmllshowbuffer{xmltest}{whateverall()}{id}
163\xmllshowbuffer{xmltest}{whocaresposition(2)}{id}
164\xmllshowbuffer{xmltest}{whocaresposition(2)}{id}
165\xmllshowbuffer{xmltest}{whocares[1]}{id}
166\xmllshowbuffer{xmltest}{whocares[1]}{id}
167\xmllshowbuffer{xmltest}{whocares[2]}{id}
168\xmllshowbuffer{xmltest}{whocares[2]}{id}
169\xmllshowbuffer{xmltest}{whatever[3]attribute(id)}{id}
170\xmllshowbuffer{xmltest}{whatever[2]attribute(id)}{id}
171\xmllshowbuffer{xmltest}{whatever[3]text()}{id}
172\xmllshowbuffer{xmltest}{whocaresfirst()}{id}
173\xmllshowbuffer{xmltest}{whocareslast()}{id}
174
175\xmllshowbuffer{xmltest}{xml:whateverall()}{id}
176\xmllshowbuffer{xmltest}{whateverall()}{id}
177\xmllshowbuffer{xmltest}{whocares}{id}
178\xmllshowbuffer{xmltest}{..[2]}{id}
179\xmllshowbuffer{xmltest}{..*[2]}{id}
180
181\xmllshowbuffer{xmltest}{(whocareswhocaresnot)}{id}
182\xmllshowbuffer{xmltest}{!(whocareswhocaresnot)}{id}
183\xmllshowbuffer{xmltest}{!whocares}{id}
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207\stoptext
208 |