public List<FunctionEntry> getFunctions(QName qname) { return getFunctions("{" + qname.getNamespaceURI() + "}" + qname.getLocalPart()); }
public List<FunctionEntry> getFunctions(QName qname) { return getFunctions("{" + qname.getNamespaceURI() + "}" + qname.getLocalPart()); }
public boolean isAvailable(StructuredQName functionName, int arity) { String key = functionName.getClarkName(); List<FunctionEntry> functions = index.getFunctions(key); if (functions != null) { for (FunctionEntry fe : functions) { if (arity == -1) { return true; } if (arity >= fe.getMinArgs() && arity <= fe.getMaxArgs()) { return true; } } } return false; }
public boolean isAvailable(StructuredQName functionName, int arity) { String key = functionName.getClarkName(); List<FunctionEntry> functions = index.getFunctions(key); if (functions != null) { for (FunctionEntry fe : functions) { if (arity == -1) { return true; } if (arity >= fe.getMinArgs() && arity <= fe.getMaxArgs()) { return true; } } } return false; }
List<FunctionEntry> functions = index.getFunctions(key); Node paramsNode = NodeOverNodeInfo.wrap(params); List<Element> paramElements = DomUtils.getElementsByTagName(paramsNode,
List<FunctionEntry> functions = index.getFunctions(key); Node paramsNode = NodeOverNodeInfo.wrap(params); List<Element> paramElements = DomUtils.getElementsByTagName(paramsNode,
public Expression bind(StructuredQName functionName, Expression[] staticArgs, StaticContext env) throws XPathException { if (functionName.getNamespaceURI().equals(Test.TE_NS) && functionName.getLocalName().equals("get-type")) { return new GetTypeFunctionCall(functionName, staticArgs, env); } String key = functionName.getClarkName(); List<FunctionEntry> functions = index.getFunctions(key); int argCount = staticArgs.length; if (functions != null) { for (FunctionEntry fe : functions) { if (argCount >= fe.getMinArgs() && argCount <= fe.getMaxArgs()) { if (fe.isJava()) { TEJavaFunctionCall fc = new TEJavaFunctionCall(fe, functionName, staticArgs, env); return fc; } else { TEXSLFunctionCall fc = new TEXSLFunctionCall(fe, functionName, staticArgs, env); return fc; } } } } // Just return null rather than throw an exception, because there may be // another function library that supports this function return null; }
/** * Loads all of the XSL executables. This is a time consuming operation. * * @param index * @param sourcesName * A stylesheet reference. * @throws Exception * If the stylesheet fail to compile. */ public void preload(Index index, String sourcesName) throws Exception { for (String key : index.getTestKeys()) { TestEntry te = index.getTest(key); loadExecutable(te, sourcesName); } for (String key : index.getFunctionKeys()) { List<FunctionEntry> functions = index.getFunctions(key); for (FunctionEntry fe : functions) { if (!fe.isJava()) { loadExecutable(fe, sourcesName); } } } }
public Expression bind(StructuredQName functionName, Expression[] staticArgs, StaticContext env) throws XPathException { if (functionName.getNamespaceURI().equals(Test.TE_NS) && functionName.getLocalName().equals("get-type")) { return new GetTypeFunctionCall(functionName, staticArgs, env); } String key = functionName.getClarkName(); List<FunctionEntry> functions = index.getFunctions(key); int argCount = staticArgs.length; if (functions != null) { for (FunctionEntry fe : functions) { if (argCount >= fe.getMinArgs() && argCount <= fe.getMaxArgs()) { if (fe.isJava()) { TEJavaFunctionCall fc = new TEJavaFunctionCall(fe, functionName, staticArgs, env); return fc; } else { TEXSLFunctionCall fc = new TEXSLFunctionCall(fe, functionName, staticArgs, env); return fc; } } } } // Just return null rather than throw an exception, because there may be // another function library that supports this function return null; }
/** * Loads all of the XSL executables. This is a time consuming operation. * * @param index * @param sourcesName * A stylesheet reference. * @throws Exception * If the stylesheet fail to compile. */ public void preload(Index index, String sourcesName) throws Exception { for (String key : index.getTestKeys()) { TestEntry te = index.getTest(key); loadExecutable(te, sourcesName); } for (String key : index.getFunctionKeys()) { List<FunctionEntry> functions = index.getFunctions(key); for (FunctionEntry fe : functions) { if (!fe.isJava()) { loadExecutable(fe, sourcesName); } } } }