1 16 19 package org.apache.xalan.templates; 20 21 import org.apache.xpath.ExpressionOwner; 22 import org.apache.xpath.XPathVisitor; 23 import org.apache.xpath.axes.LocPathIterator; 24 import org.apache.xpath.functions.FuncCurrent; 25 import org.apache.xpath.functions.FuncExtFunction; 26 import org.apache.xpath.functions.Function; 27 import org.apache.xpath.operations.Variable; 28 29 33 public class AbsPathChecker extends XPathVisitor 34 { 35 private boolean m_isAbs = true; 36 37 44 public boolean checkAbsolute(LocPathIterator path) 45 { 46 m_isAbs = true; 47 path.callVisitors(null, this); 48 return m_isAbs; 49 } 50 51 58 public boolean visitFunction(ExpressionOwner owner, Function func) 59 { 60 if((func instanceof FuncCurrent) || 61 (func instanceof FuncExtFunction)) 62 m_isAbs = false; 63 return true; 64 } 65 66 73 public boolean visitVariableRef(ExpressionOwner owner, Variable var) 74 { 75 m_isAbs = false; 76 return true; 77 } 78 } 79 80 | Popular Tags |