1 28 29 package com.caucho.xpath.pattern; 30 31 import com.caucho.xml.XmlUtil; 32 import com.caucho.xpath.ExprEnvironment; 33 34 import org.w3c.dom.Node ; 35 36 39 public class FromAny extends Axis { 40 public FromAny() 41 { 42 super(null); 43 } 44 45 53 public boolean match(Node node, ExprEnvironment env) 54 { 55 return true; 56 } 57 58 65 public Node firstNode(Node node, ExprEnvironment env) 66 { 67 Node owner = node.getOwnerDocument(); 68 if (owner == null) 69 return node; 70 else 71 return owner; 72 } 73 74 82 public Node nextNode(Node node, Node lastNode) 83 { 84 return XmlUtil.getNext(node); 85 } 86 87 90 public boolean isStrictlyAscending() 91 { 92 return false; 93 } 94 95 102 public int position(Node node, ExprEnvironment env, AbstractPattern pattern) 103 { 104 throw new RuntimeException (); 105 } 106 107 114 public int count(Node node, ExprEnvironment env, AbstractPattern pattern) 115 { 116 throw new RuntimeException (); 117 } 118 119 122 public boolean equals(Object b) 123 { 124 return b instanceof FromAny; 125 } 126 127 public String toString() 128 { 129 return "node()"; 130 } 131 } 132 | Popular Tags |