1 package com.icl.saxon.om; 2 import com.icl.saxon.pattern.NodeTest; 3 import com.icl.saxon.expr.XPathException; 4 5 8 9 public final class Axis { 10 11 14 15 public static final byte ANCESTOR = 0; 16 public static final byte ANCESTOR_OR_SELF = 1; 17 public static final byte ATTRIBUTE = 2; 18 public static final byte CHILD = 3; 19 public static final byte DESCENDANT = 4; 20 public static final byte DESCENDANT_OR_SELF = 5; 21 public static final byte FOLLOWING = 6; 22 public static final byte FOLLOWING_SIBLING = 7; 23 public static final byte NAMESPACE = 8; 24 public static final byte PARENT = 9; 25 public static final byte PRECEDING = 10; 26 public static final byte PRECEDING_SIBLING = 11; 27 public static final byte SELF = 12; 28 29 32 public static final byte PRECEDING_OR_ANCESTOR = 13; 33 34 35 38 39 public static final short[] principalNodeType = 40 { 41 NodeInfo.ELEMENT, NodeInfo.ELEMENT, NodeInfo.ATTRIBUTE, NodeInfo.ELEMENT, NodeInfo.ELEMENT, NodeInfo.ELEMENT, NodeInfo.ELEMENT, NodeInfo.ELEMENT, NodeInfo.NAMESPACE, NodeInfo.ELEMENT, NodeInfo.ELEMENT, NodeInfo.ELEMENT, NodeInfo.ELEMENT, NodeInfo.ELEMENT, }; 56 57 60 61 public static final boolean[] isForwards = 62 { 63 false, false, true, true, true, true, true, true, false, true, false, false, true, false, }; 78 79 82 83 public static final boolean[] isReverse = 84 { 85 true, true, false, false, false, false, false, false, false, true, true, true, true, true, }; 100 101 105 106 public static final boolean[] isPeerAxis = 107 { 108 false, false, true, true, false, false, false, true, false, true, false, true, true, false, }; 123 124 128 129 public static final boolean[] isSubtreeAxis = 130 { 131 false, false, true, true, true, true, false, false, false, false, false, false, true, false, }; 146 147 150 151 public static final String [] axisName = 152 { 153 "ancestor", "ancestor-or-self", "attribute", "child", "descendant", "descendant-or-self", "following", "following-sibling", "namespace", "parent", "preceding", "preceding-sibling", "self", "preceding-or-ancestor", }; 168 169 172 173 public static byte getAxisNumber(String name) throws XPathException { 174 if (name.equals("ancestor")) return ANCESTOR; 175 if (name.equals("ancestor-or-self")) return ANCESTOR_OR_SELF; 176 if (name.equals("attribute")) return ATTRIBUTE; 177 if (name.equals("child")) return CHILD; 178 if (name.equals("descendant")) return DESCENDANT; 179 if (name.equals("descendant-or-self")) return DESCENDANT_OR_SELF; 180 if (name.equals("following")) return FOLLOWING; 181 if (name.equals("following-sibling")) return FOLLOWING_SIBLING; 182 if (name.equals("namespace")) return NAMESPACE; 183 if (name.equals("parent")) return PARENT; 184 if (name.equals("preceding")) return PRECEDING; 185 if (name.equals("preceding-sibling")) return PRECEDING_SIBLING; 186 if (name.equals("self")) return SELF; 187 throw new XPathException("Unknown axis name: " + name); 189 } 190 191 192 193 } 194 195 211 212 213 | Popular Tags |