Debian Codegraph @

net/sf/saxon/om/AxisInfo.java

raw symbols SCIP
1 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2018 Saxonica Limited.
3 // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4 // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
6 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7
8 package net.sf.saxon.om;
9
10 import net.sf.saxon.trans.XPathException;
11 import net.sf.saxon.type.PrimitiveUType;
12 import net.sf.saxon.type.Type;
13 import net.sf.saxon.type.UType;
14 import net.sf.saxon.z.IntHashMap;
15
16 import java.util.Set;
17
18 /**
19 * An axis, that is a direction of navigation in the document structure.
20 */
21
22 public final class AxisInfo {
23
24 /**
25 * Constant representing the ancestor axis
26 */
27
28 public static final byte ANCESTOR = 0;
29 /**
30 * Constant representing the ancestor-or-self axis
31 */
32 public static final byte ANCESTOR_OR_SELF = 1;
33 /**
34 * Constant representing the attribute axis
35 */
36 public static final byte ATTRIBUTE = 2;
37 /**
38 * Constant representing the child axis
39 */
40 public static final byte CHILD = 3;
41 /**
42 * Constant representing the descendant axis
43 */
44 public static final byte DESCENDANT = 4;
45 /**
46 * Constant representing the descendant-or-self axis
47 */
48 public static final byte DESCENDANT_OR_SELF = 5;
49 /**
50 * Constant representing the following axis
51 */
52 public static final byte FOLLOWING = 6;
53 /**
54 * Constant representing the following-sibling axis
55 */
56 public static final byte FOLLOWING_SIBLING = 7;
57 /**
58 * Constant representing the namespace axis
59 */
60 public static final byte NAMESPACE = 8;
61 /**
62 * Constant representing the parent axis
63 */
64 public static final byte PARENT = 9;
65 /**
66 * Constant representing the preceding axis
67 */
68 public static final byte PRECEDING = 10;
69 /**
70 * Constant representing the preceding-sibling axis
71 */
72 public static final byte PRECEDING_SIBLING = 11;
73 /**
74 * Constant representing the self axis
75 */
76 public static final byte SELF = 12;
77
78 // preceding-or-ancestor axis gives all preceding nodes including ancestors,
79 // in reverse document order
80
81 /**
82 * Constant representing the preceding-or-ancestor axis. This axis is used internally by the xsl:number implementation, it returns the union of the preceding axis and the ancestor axis.
83 */
84 public static final byte PRECEDING_OR_ANCESTOR = 13;
85
86 /**
87 * Table indicating the principal node type of each axis
88 */
89
90 public static final short[] principalNodeType =
91 {
92 Type.ELEMENT, // ANCESTOR
93 Type.ELEMENT, // ANCESTOR_OR_SELF;
94 Type.ATTRIBUTE, // ATTRIBUTE;
95 Type.ELEMENT, // CHILD;
96 Type.ELEMENT, // DESCENDANT;
97 Type.ELEMENT, // DESCENDANT_OR_SELF;
98 Type.ELEMENT, // FOLLOWING;
99 Type.ELEMENT, // FOLLOWING_SIBLING;
100 Type.NAMESPACE, // NAMESPACE;
101 Type.ELEMENT, // PARENT;
102 Type.ELEMENT, // PRECEDING;
103 Type.ELEMENT, // PRECEDING_SIBLING;
104 Type.ELEMENT, // SELF;
105 Type.ELEMENT, // PRECEDING_OR_ANCESTOR;
106 };
107
108 public static final UType[] principalNodeUType =
109 {
110 UType.ELEMENT, // ANCESTOR
111 UType.ELEMENT, // ANCESTOR_OR_SELF;
112 UType.ATTRIBUTE, // ATTRIBUTE;
113 UType.ELEMENT, // CHILD;
114 UType.ELEMENT, // DESCENDANT;
115 UType.ELEMENT, // DESCENDANT_OR_SELF;
116 UType.ELEMENT, // FOLLOWING;
117 UType.ELEMENT, // FOLLOWING_SIBLING;
118 UType.NAMESPACE, // NAMESPACE;
119 UType.ELEMENT, // PARENT;
120 UType.ELEMENT, // PRECEDING;
121 UType.ELEMENT, // PRECEDING_SIBLING;
122 UType.ELEMENT, // SELF;
123 UType.ELEMENT, // PRECEDING_OR_ANCESTOR;
124 };
125
126 /**
127 * Table indicating for each axis whether it is in forwards document order
128 */
129
130 public static final boolean[] isForwards =
131 {
132 false, // ANCESTOR
133 false, // ANCESTOR_OR_SELF;
134 true, // ATTRIBUTE;
135 true, // CHILD;
136 true, // DESCENDANT;
137 true, // DESCENDANT_OR_SELF;
138 true, // FOLLOWING;
139 true, // FOLLOWING_SIBLING;
140 true, // NAMESPACE;
141 true, // PARENT;
142 false, // PRECEDING;
143 false, // PRECEDING_SIBLING;
144 true, // SELF;
145 false, // PRECEDING_OR_ANCESTOR;
146 };
147
148 /**
149 * Table indicating for each axis whether it is in reverse document order
150 */
151
152 // public static final boolean[] isReverse =
153 // {
154 // true, // ANCESTOR
155 // true, // ANCESTOR_OR_SELF;
156 // false, // ATTRIBUTE;
157 // false, // CHILD;
158 // false, // DESCENDANT;
159 // false, // DESCENDANT_OR_SELF;
160 // false, // FOLLOWING;
161 // false, // FOLLOWING_SIBLING;
162 // false, // NAMESPACE;
163 // true, // PARENT;
164 // true, // PRECEDING;
165 // true, // PRECEDING_SIBLING;
166 // true, // SELF;
167 // true, // PRECEDING_OR_ANCESTOR;
168 // };
169
170 /**
171 * Table indicating for each axis whether it is a peer axis. An axis is a peer
172 * axis if no node on the axis is an ancestor of another node on the axis.
173 */
174
175 public static final boolean[] isPeerAxis =
176 {
177 false, // ANCESTOR
178 false, // ANCESTOR_OR_SELF;
179 true, // ATTRIBUTE;
180 true, // CHILD;
181 false, // DESCENDANT;
182 false, // DESCENDANT_OR_SELF;
183 false, // FOLLOWING;
184 true, // FOLLOWING_SIBLING;
185 true, // NAMESPACE;
186 true, // PARENT;
187 false, // PRECEDING;
188 true, // PRECEDING_SIBLING;
189 true, // SELF;
190 false, // PRECEDING_OR_ANCESTOR;
191 };
192
193 /**
194 * Table indicating for each axis whether it is contained within the subtree
195 * rooted at the origin node.
196 */
197
198 public static final boolean[] isSubtreeAxis =
199 {
200 false, // ANCESTOR
201 false, // ANCESTOR_OR_SELF;
202 true, // ATTRIBUTE;
203 true, // CHILD;
204 true, // DESCENDANT;
205 true, // DESCENDANT_OR_SELF;
206 false, // FOLLOWING;
207 false, // FOLLOWING_SIBLING;
208 true, // NAMESPACE;
209 false, // PARENT;
210 false, // PRECEDING;
211 false, // PRECEDING_SIBLING;
212 true, // SELF;
213 false, // PRECEDING_OR_ANCESTOR;
214 };
215
216 /**
217 * Table giving the name of each axis as used in XPath, for example "ancestor-or-self"
218 */
219
220 public static final String[] axisName =
221 {
222 "ancestor", // ANCESTOR
223 "ancestor-or-self", // ANCESTOR_OR_SELF;
224 "attribute", // ATTRIBUTE;
225 "child", // CHILD;
226 "descendant", // DESCENDANT;
227 "descendant-or-self", // DESCENDANT_OR_SELF;
228 "following", // FOLLOWING;
229 "following-sibling", // FOLLOWING_SIBLING;
230 "namespace", // NAMESPACE;
231 "parent", // PARENT;
232 "preceding", // PRECEDING;
233 "preceding-sibling", // PRECEDING_SIBLING;
234 "self", // SELF;
235 "preceding-or-ancestor",// PRECEDING_OR_ANCESTOR;
236 };
237
238 /**
239 * The class is never instantiated
240 */
241
242 private AxisInfo() {
243 }
244
245 /**
246 * Resolve an axis name into a symbolic constant representing the axis
247 *
248 * @param name the name of the axis
249 * @return integer value representing the named axis
250 * @throws XPathException if the axis name is not one of the defined axes
251 */
252
253 public static byte getAxisNumber(String name) throws XPathException {
254 switch (name.length()) {
255 case 4:
256 if (name.equals("self")) {
257 return SELF;
258 }
259 break;
260 case 5:
261 if (name.equals("child")) {
262 return CHILD;
263 }
264 break;
265 case 6:
266 if (name.equals("parent")) {
267 return PARENT;
268 }
269 break;
270 case 8:
271 if (name.equals("ancestor")) {
272 return ANCESTOR;
273 }
274 break;
275 case 9:
276 if (name.equals("attribute")) {
277 return ATTRIBUTE;
278 }
279 if (name.equals("following")) {
280 return FOLLOWING;
281 }
282 if (name.equals("namespace")) {
283 return NAMESPACE;
284 }
285 if (name.equals("preceding")) {
286 return PRECEDING;
287 }
288 break;
289 case 10:
290 if (name.equals("descendant")) {
291 return DESCENDANT;
292 }
293 break;
294 case 16:
295 if (name.equals("ancestor-or-self")) {
296 return ANCESTOR_OR_SELF;
297 }
298 break;
299 case 17:
300 if (name.equals("following-sibling")) {
301 return FOLLOWING_SIBLING;
302 }
303 if (name.equals("preceding-sibling")) {
304 return PRECEDING_SIBLING;
305 }
306 break;
307 case 18:
308 if (name.equals("descendant-or-self")) {
309 return DESCENDANT_OR_SELF;
310 }
311 break;
312 }
313 // preceding-or-ancestor cannot be used in an XPath expression
314 throw new XPathException("Unknown axis name: " + name);
315
316 }
317
318 /**
319 * The following table indicates the combinations of axis and origin node-kind that always
320 * return an empty result.
321 */
322
323 private static final int DOC = 1 << Type.DOCUMENT;
324 private static final int ELE = 1 << Type.ELEMENT;
325 private static final int ATT = 1 << Type.ATTRIBUTE;
326 private static final int TEX = 1 << Type.TEXT;
327 private static final int PIN = 1 << Type.PROCESSING_INSTRUCTION;
328 private static final int COM = 1 << Type.COMMENT;
329 private static final int NAM = 1 << Type.NAMESPACE;
330
331 private static int[] voidAxisTable = {
332 DOC, // ANCESTOR
333 0, // ANCESTOR_OR_SELF;
334 DOC | ATT | TEX | PIN | COM | NAM, // ATTRIBUTE;
335 ATT | TEX | PIN | COM | NAM, // CHILD;
336 ATT | TEX | PIN | COM | NAM, // DESCENDANT;
337 0, // DESCENDANT_OR_SELF;
338 DOC, // FOLLOWING;
339 DOC | ATT | NAM, // FOLLOWING_SIBLING;
340 DOC | ATT | TEX | PIN | COM | NAM, // NAMESPACE;
341 DOC, // PARENT;
342 DOC, // PRECEDING;
343 DOC | ATT | NAM, // PRECEDING_SIBLING;
344 0, // SELF;
345 };
346
347 /**
348 * Ask whether a given axis can contain any nodes when starting at the specified node kind.
349 * For example, the attribute axis when starting at an attribute node will always be empty
350 *
351 * @param axis the axis, for example {@link AxisInfo#ATTRIBUTE}
352 * @param nodeKind the node kind of the origin node, for example {@link Type#ATTRIBUTE}
353 * @return true if no nodes will ever appear on the specified axis when starting at the specified
354 * node kind.
355 */
356
357 public static boolean isAlwaysEmpty(int axis, int nodeKind) {
358 return (voidAxisTable[axis] & (1 << nodeKind)) != 0;
359 }
360
361 /**
362 * The following table indicates the kinds of node found on each axis
363 */
364
365 private static int[] nodeKindTable = {
366 DOC | ELE, // ANCESTOR
367 DOC | ELE | ATT | TEX | PIN | COM | NAM, // ANCESTOR_OR_SELF;
368 ATT, // ATTRIBUTE;
369 ELE | TEX | PIN | COM, // CHILD;
370 ELE | TEX | PIN | COM, // DESCENDANT;
371 DOC | ELE | ATT | TEX | PIN | COM | NAM, // DESCENDANT_OR_SELF;
372 ELE | TEX | PIN | COM, // FOLLOWING;
373 ELE | TEX | PIN | COM, // FOLLOWING_SIBLING;
374 NAM, // NAMESPACE;
375 DOC | ELE, // PARENT;
376 ELE | TEX | PIN | COM, // PRECEDING;
377 ELE | TEX | PIN | COM, // PRECEDING_SIBLING;
378 DOC | ELE | ATT | TEX | PIN | COM | NAM, // SELF;
379 };
380
381 /**
382 * Determine whether a given kind of node can be found on a given axis. For example,
383 * the attribute axis will never contain any element nodes.
384 *
385 * @param axis the axis, for example {@link AxisInfo#ATTRIBUTE}
386 * @param nodeKind the node kind of the origin node, for example {@link Type#ELEMENT}
387 * @return true if the given kind of node can appear on the specified axis
388 */
389
390 public static boolean containsNodeKind(int axis, int nodeKind) {
391 return nodeKind == Type.NODE || (nodeKindTable[axis] & (1 << nodeKind)) != 0;
392 }
393
394 /**
395 * For each axis, determine the inverse axis, in the sense that if A is on axis X starting at B,
396 * the B is on the axis inverseAxis[X] starting at A. This doesn't quite work for the PARENT axis,
397 * which has no simple inverse: this table gives the inverse as CHILD
398 */
399
400 public static byte[] inverseAxis = {
401 DESCENDANT, // ANCESTOR
402 DESCENDANT_OR_SELF, // ANCESTOR_OR_SELF;
403 PARENT, // ATTRIBUTE;
404 PARENT, // CHILD;
405 ANCESTOR, // DESCENDANT;
406 ANCESTOR_OR_SELF, // DESCENDANT_OR_SELF;
407 PRECEDING, // FOLLOWING;
408 PRECEDING_SIBLING, // FOLLOWING_SIBLING;
409 PARENT, // NAMESPACE;
410 CHILD, // PARENT;
411 FOLLOWING, // PRECEDING;
412 FOLLOWING_SIBLING, // PRECEDING_SIBLING;
413 SELF // SELF;
414 };
415
416 /**
417 * Give the corresponding axis if the self node is excluded. (Doesn't really
418 * work for the self axis itself).
419 */
420
421 public static byte[] excludeSelfAxis = {
422 ANCESTOR, // ANCESTOR
423 ANCESTOR, // ANCESTOR_OR_SELF;
424 ATTRIBUTE, // ATTRIBUTE;
425 CHILD, // CHILD;
426 DESCENDANT, // DESCENDANT;
427 DESCENDANT, // DESCENDANT_OR_SELF;
428 FOLLOWING, // FOLLOWING;
429 FOLLOWING_SIBLING, // FOLLOWING_SIBLING;
430 NAMESPACE, // NAMESPACE;
431 PARENT, // PARENT;
432 PRECEDING, // PRECEDING;
433 PRECEDING_SIBLING, // PRECEDING_SIBLING;
434 SELF // SELF;
435 };
436
437
438 private static IntHashMap<UType> axisTransitions = new IntHashMap<UType>(50);
439
440 private static void e(PrimitiveUType origin, byte axis, UType target) {
441 axisTransitions.put(makeKey(origin, axis), target);
442 }
443
444 private static int makeKey(PrimitiveUType origin, byte axis) {
445 return origin.getBit()<<16 | (int)axis;
446 }
447
448 /**
449 * Given a context item type and an axis, determine the kinds of nodes that can be returned
450 * @param origin the context item type, as a UType representing one or more node kinds
451 * @param axis identifies the axis
452 * @return the set of possible node kinds in the result of the axis expression, as a UType
453 */
454
455 public static UType getTargetUType(UType origin, byte axis) {
456 UType resultType = UType.VOID;
457 Set<PrimitiveUType> origins = origin.intersection(UType.ANY_NODE).decompose();
458 for (PrimitiveUType u : origins) {
459 UType r = axisTransitions.get(makeKey(u, axis));
460 resultType = resultType.union(r);
461 }
462 return resultType;
463 }
464
465 static {
466
467 // Declare as triples the relationships that can exist between nodes. The first argument is the type
468 // of the origin node; the second is the axis; the third is the set of node kinds that can be found
469 // using this axis, when starting from this origin.
470
471 e(PrimitiveUType.DOCUMENT, ANCESTOR, UType.VOID);
472 e(PrimitiveUType.DOCUMENT, ANCESTOR_OR_SELF, UType.DOCUMENT);
473 e(PrimitiveUType.DOCUMENT, ATTRIBUTE, UType.VOID);
474 e(PrimitiveUType.DOCUMENT, CHILD, UType.CHILD_NODE_KINDS);
475 e(PrimitiveUType.DOCUMENT, DESCENDANT, UType.CHILD_NODE_KINDS);
476 e(PrimitiveUType.DOCUMENT, DESCENDANT_OR_SELF, UType.DOCUMENT.union(UType.CHILD_NODE_KINDS));
477 e(PrimitiveUType.DOCUMENT, FOLLOWING, UType.VOID);
478 e(PrimitiveUType.DOCUMENT, FOLLOWING_SIBLING, UType.VOID);
479 e(PrimitiveUType.DOCUMENT, NAMESPACE, UType.VOID);
480 e(PrimitiveUType.DOCUMENT, PARENT, UType.VOID);
481 e(PrimitiveUType.DOCUMENT, PRECEDING, UType.VOID);
482 e(PrimitiveUType.DOCUMENT, PRECEDING_SIBLING, UType.VOID);
483 e(PrimitiveUType.DOCUMENT, SELF, UType.DOCUMENT);
484
485 e(PrimitiveUType.ELEMENT, ANCESTOR, UType.PARENT_NODE_KINDS);
486 e(PrimitiveUType.ELEMENT, ANCESTOR_OR_SELF, UType.PARENT_NODE_KINDS);
487 e(PrimitiveUType.ELEMENT, ATTRIBUTE, UType.ATTRIBUTE);
488 e(PrimitiveUType.ELEMENT, CHILD, UType.CHILD_NODE_KINDS);
489 e(PrimitiveUType.ELEMENT, DESCENDANT, UType.CHILD_NODE_KINDS);
490 e(PrimitiveUType.ELEMENT, DESCENDANT_OR_SELF, UType.CHILD_NODE_KINDS);
491 e(PrimitiveUType.ELEMENT, FOLLOWING, UType.CHILD_NODE_KINDS);
492 e(PrimitiveUType.ELEMENT, FOLLOWING_SIBLING, UType.CHILD_NODE_KINDS);
493 e(PrimitiveUType.ELEMENT, NAMESPACE, UType.NAMESPACE);
494 e(PrimitiveUType.ELEMENT, PARENT, UType.PARENT_NODE_KINDS);
495 e(PrimitiveUType.ELEMENT, PRECEDING, UType.CHILD_NODE_KINDS);
496 e(PrimitiveUType.ELEMENT, PRECEDING_SIBLING, UType.CHILD_NODE_KINDS);
497 e(PrimitiveUType.ELEMENT, SELF, UType.ELEMENT);
498
499 e(PrimitiveUType.ATTRIBUTE, ANCESTOR, UType.PARENT_NODE_KINDS);
500 e(PrimitiveUType.ATTRIBUTE, ANCESTOR_OR_SELF, UType.ATTRIBUTE.union(UType.PARENT_NODE_KINDS));
501 e(PrimitiveUType.ATTRIBUTE, ATTRIBUTE, UType.VOID);
502 e(PrimitiveUType.ATTRIBUTE, CHILD, UType.VOID);
503 e(PrimitiveUType.ATTRIBUTE, DESCENDANT, UType.VOID);
504 e(PrimitiveUType.ATTRIBUTE, DESCENDANT_OR_SELF, UType.ATTRIBUTE);
505 e(PrimitiveUType.ATTRIBUTE, FOLLOWING, UType.CHILD_NODE_KINDS);
506 e(PrimitiveUType.ATTRIBUTE, FOLLOWING_SIBLING, UType.VOID);
507 e(PrimitiveUType.ATTRIBUTE, NAMESPACE, UType.VOID);
508 e(PrimitiveUType.ATTRIBUTE, PARENT, UType.ELEMENT);
509 e(PrimitiveUType.ATTRIBUTE, PRECEDING, UType.CHILD_NODE_KINDS);
510 e(PrimitiveUType.ATTRIBUTE, PRECEDING_SIBLING, UType.VOID);
511 e(PrimitiveUType.ATTRIBUTE, SELF, UType.ATTRIBUTE);
512
513 e(PrimitiveUType.TEXT, ANCESTOR, UType.PARENT_NODE_KINDS);
514 e(PrimitiveUType.TEXT, ANCESTOR_OR_SELF, UType.TEXT.union(UType.PARENT_NODE_KINDS));
515 e(PrimitiveUType.TEXT, ATTRIBUTE, UType.VOID);
516 e(PrimitiveUType.TEXT, CHILD, UType.VOID);
517 e(PrimitiveUType.TEXT, DESCENDANT, UType.VOID);
518 e(PrimitiveUType.TEXT, DESCENDANT_OR_SELF, UType.TEXT);
519 e(PrimitiveUType.TEXT, FOLLOWING, UType.CHILD_NODE_KINDS);
520 e(PrimitiveUType.TEXT, FOLLOWING_SIBLING, UType.CHILD_NODE_KINDS);
521 e(PrimitiveUType.TEXT, NAMESPACE, UType.VOID);
522 e(PrimitiveUType.TEXT, PARENT, UType.PARENT_NODE_KINDS);
523 e(PrimitiveUType.TEXT, PRECEDING, UType.CHILD_NODE_KINDS);
524 e(PrimitiveUType.TEXT, PRECEDING_SIBLING, UType.CHILD_NODE_KINDS);
525 e(PrimitiveUType.TEXT, SELF, UType.TEXT);
526
527 e(PrimitiveUType.PI, ANCESTOR, UType.PARENT_NODE_KINDS);
528 e(PrimitiveUType.PI, ANCESTOR_OR_SELF, UType.PI.union(UType.PARENT_NODE_KINDS));
529 e(PrimitiveUType.PI, ATTRIBUTE, UType.VOID);
530 e(PrimitiveUType.PI, CHILD, UType.VOID);
531 e(PrimitiveUType.PI, DESCENDANT, UType.VOID);
532 e(PrimitiveUType.PI, DESCENDANT_OR_SELF, UType.PI);
533 e(PrimitiveUType.PI, FOLLOWING, UType.CHILD_NODE_KINDS);
534 e(PrimitiveUType.PI, FOLLOWING_SIBLING, UType.CHILD_NODE_KINDS);
535 e(PrimitiveUType.PI, NAMESPACE, UType.VOID);
536 e(PrimitiveUType.PI, PARENT, UType.PARENT_NODE_KINDS);
537 e(PrimitiveUType.PI, PRECEDING, UType.CHILD_NODE_KINDS);
538 e(PrimitiveUType.PI, PRECEDING_SIBLING, UType.CHILD_NODE_KINDS);
539 e(PrimitiveUType.PI, SELF, UType.PI);
540
541 e(PrimitiveUType.COMMENT, ANCESTOR, UType.PARENT_NODE_KINDS);
542 e(PrimitiveUType.COMMENT, ANCESTOR_OR_SELF, UType.COMMENT.union(UType.PARENT_NODE_KINDS));
543 e(PrimitiveUType.COMMENT, ATTRIBUTE, UType.VOID);
544 e(PrimitiveUType.COMMENT, CHILD, UType.VOID);
545 e(PrimitiveUType.COMMENT, DESCENDANT, UType.VOID);
546 e(PrimitiveUType.COMMENT, DESCENDANT_OR_SELF, UType.COMMENT);
547 e(PrimitiveUType.COMMENT, FOLLOWING, UType.CHILD_NODE_KINDS);
548 e(PrimitiveUType.COMMENT, FOLLOWING_SIBLING, UType.CHILD_NODE_KINDS);
549 e(PrimitiveUType.COMMENT, NAMESPACE, UType.VOID);
550 e(PrimitiveUType.COMMENT, PARENT, UType.PARENT_NODE_KINDS);
551 e(PrimitiveUType.COMMENT, PRECEDING, UType.CHILD_NODE_KINDS);
552 e(PrimitiveUType.COMMENT, PRECEDING_SIBLING, UType.CHILD_NODE_KINDS);
553 e(PrimitiveUType.COMMENT, SELF, UType.COMMENT);
554
555 e(PrimitiveUType.NAMESPACE, ANCESTOR, UType.PARENT_NODE_KINDS);
556 e(PrimitiveUType.NAMESPACE, ANCESTOR_OR_SELF, UType.NAMESPACE.union(UType.PARENT_NODE_KINDS));
557 e(PrimitiveUType.NAMESPACE, ATTRIBUTE, UType.VOID);
558 e(PrimitiveUType.NAMESPACE, CHILD, UType.VOID);
559 e(PrimitiveUType.NAMESPACE, DESCENDANT, UType.VOID);
560 e(PrimitiveUType.NAMESPACE, DESCENDANT_OR_SELF, UType.NAMESPACE);
561 e(PrimitiveUType.NAMESPACE, FOLLOWING, UType.CHILD_NODE_KINDS);
562 e(PrimitiveUType.NAMESPACE, FOLLOWING_SIBLING, UType.VOID);
563 e(PrimitiveUType.NAMESPACE, NAMESPACE, UType.VOID);
564 e(PrimitiveUType.NAMESPACE, PARENT, UType.ELEMENT);
565 e(PrimitiveUType.NAMESPACE, PRECEDING, UType.CHILD_NODE_KINDS);
566 e(PrimitiveUType.NAMESPACE, PRECEDING_SIBLING, UType.VOID);
567 e(PrimitiveUType.NAMESPACE, SELF, UType.NAMESPACE);
568 }
569
570 }
571
572 /*
573 // a list for any future cut-and-pasting...
574 ANCESTOR
575 ANCESTOR_OR_SELF;
576 ATTRIBUTE;
577 CHILD;
578 DESCENDANT;
579 DESCENDANT_OR_SELF;
580 FOLLOWING;
581 FOLLOWING_SIBLING;
582 NAMESPACE;
583 PARENT;
584 PRECEDING;
585 PRECEDING_SIBLING;
586 SELF;
587 */