KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xml > dtm > Axis


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 /*
17  * $Id: Axis.java,v 1.5 2004/02/16 23:03:44 minchau Exp $
18  */

19 package org.apache.xml.dtm;
20
21 /**
22  * Specifies values related to XPath Axes.
23  * <p>The ancestor, descendant, following, preceding and self axes partition a
24  * document (ignoring attribute and namespace nodes): they do not overlap
25  * and together they contain all the nodes in the document.</p>
26  *
27  */

28 public interface Axis
29 {
30
31   /**
32    * The ancestor axis contains the ancestors of the context node;
33    * the ancestors of the context node consist of the parent of context
34    * node and the parent's parent and so on; thus, the ancestor axis will
35    * always include the root node, unless the context node is the root node.
36    */

37   public static final int ANCESTOR = 0;
38
39   /**
40    * the ancestor-or-self axis contains the context node and the ancestors of
41    * the context node; thus, the ancestor axis will always include the
42    * root node.
43    */

44   public static final int ANCESTORORSELF = 1;
45
46   /**
47    * the attribute axis contains the attributes of the context node; the axis
48    * will be empty unless the context node is an element.
49    */

50   public static final int ATTRIBUTE = 2;
51
52   /** The child axis contains the children of the context node. */
53   public static final int CHILD = 3;
54
55   /**
56    * The descendant axis contains the descendants of the context node;
57    * a descendant is a child or a child of a child and so on; thus the
58    * descendant axis never contains attribute or namespace nodes.
59    */

60   public static final int DESCENDANT = 4;
61
62   /**
63    * The descendant-or-self axis contains the context node and the
64    * descendants of the context node.
65    */

66   public static final int DESCENDANTORSELF = 5;
67
68   /**
69    * the following axis contains all nodes in the same document as the
70    * context node that are after the context node in document order, excluding
71    * any descendants and excluding attribute nodes and namespace nodes.
72    */

73   public static final int FOLLOWING = 6;
74
75   /**
76    * The following-sibling axis contains all the following siblings of the
77    * context node; if the context node is an attribute node or namespace node,
78    * the following-sibling axis is empty.
79    */

80   public static final int FOLLOWINGSIBLING = 7;
81
82   /**
83    * The namespace axis contains the namespace nodes of the context node; the
84    * axis will be empty unless the context node is an element.
85    */

86   public static final int NAMESPACEDECLS = 8;
87
88   /**
89    * The namespace axis contains the namespace nodes of the context node; the
90    * axis will be empty unless the context node is an element.
91    */

92   public static final int NAMESPACE = 9;
93
94   /**
95    * The parent axis contains the parent of the context node,
96    * if there is one.
97    */

98   public static final int PARENT = 10;
99
100   /**
101    * The preceding axis contains all nodes in the same document as the context
102    * node that are before the context node in document order, excluding any
103    * ancestors and excluding attribute nodes and namespace nodes
104    */

105   public static final int PRECEDING = 11;
106
107   /**
108    * The preceding-sibling axis contains all the preceding siblings of the
109    * context node; if the context node is an attribute node or namespace node,
110    * the preceding-sibling axis is empty.
111    */

112   public static final int PRECEDINGSIBLING = 12;
113
114   /** The self axis contains just the context node itself. */
115   public static final int SELF = 13;
116
117   /**
118    * A non-xpath axis, traversing the subtree including the subtree
119    * root, descendants, attributes, and namespace node decls.
120    */

121   public static final int ALLFROMNODE = 14;
122
123   /**
124    * A non-xpath axis, traversing the the preceding and the ancestor nodes,
125    * needed for inverseing select patterns to match patterns.
126    */

127   public static final int PRECEDINGANDANCESTOR = 15;
128   
129   // ===========================================
130
// All axis past this are absolute.
131

132   /**
133    * A non-xpath axis, returns all nodes in the tree from and including the
134    * root.
135    */

136   public static final int ALL = 16;
137
138   /**
139    * A non-xpath axis, returns all nodes that aren't namespaces or attributes,
140    * from and including the root.
141    */

142   public static final int DESCENDANTSFROMROOT = 17;
143
144   /**
145    * A non-xpath axis, returns all nodes that aren't namespaces or attributes,
146    * from and including the root.
147    */

148   public static final int DESCENDANTSORSELFFROMROOT = 18;
149
150   /**
151    * A non-xpath axis, returns root only.
152    */

153   public static final int ROOT = 19;
154
155   /**
156    * A non-xpath axis, for functions.
157    */

158   public static final int FILTEREDLIST = 20;
159
160
161   /** The names of the axes for diagnostic purposes. */
162   public static final String JavaDoc[] names =
163   {
164     "ancestor", // 0
165
"ancestor-or-self", // 1
166
"attribute", // 2
167
"child", // 3
168
"descendant", // 4
169
"descendant-or-self", // 5
170
"following", // 6
171
"following-sibling", // 7
172
"namespace-decls", // 8
173
"namespace", // 9
174
"parent", // 10
175
"preceding", // 11
176
"preceding-sibling", // 12
177
"self", // 13
178
"all-from-node", // 14
179
"preceding-and-ancestor", // 15
180
"all", // 16
181
"descendants-from-root", // 17
182
"descendants-or-self-from-root", // 18
183
"root", // 19
184
"filtered-list" // 20
185
};
186 }
187
Popular Tags