public FilteredFunctionContext(Set<String> illegalFunctions) { this.illegalFunctions = illegalFunctions; base = XPathFunctionContext.getInstance(); }
@Override public Function getFunction(String namespaceURI, String prefix, String localName) throws UnresolvableException { try { return super.getFunction(namespaceURI, prefix, localName); } catch (UnresolvableException e) { return super.getFunction(null, null, localName); } } };
private void registerXSLTFunctions() { // extension functions defined in XSLT registerFunction( null, // namespace URI "document", new DocumentFunction() ); }
/** * Create a new <code>GMLObjectXPath</code> from an XPath expression string. * * @param xpathExpr * the XPath expression, must not be <code>null</code> * @param root * root of the navigation hierarchy (document node), must not be <code>null</code> * @throws JaxenException * if there is a syntax error in the expression */ public GMLObjectXPath( String xpathExpr, GMLObject root ) throws JaxenException { super( xpathExpr, new GMLObjectNavigator( root ) ); SimpleFunctionContext fc = new XPathFunctionContext(); fc.registerFunction( WFS_200_NS, "valueOf", new ValueOf() ); fc.registerFunction( null, "valueOf", new ValueOf() ); SimpleNamespaceContext nc = new SimpleNamespaceContext(); nc.addNamespace( "wfs", WFS_200_NS ); setFunctionContext( fc ); setNamespaceContext( nc ); } }
/** Create a default <code>FunctionContext</code>. * * @return a default <code>FunctionContext</code> */ protected FunctionContext createFunctionContext() { return XPathFunctionContext.getInstance(); }
public Function getFunction(String namespaceURI, String prefix, String localName) throws UnresolvableException { try { return super.getFunction(namespaceURI, prefix, localName); } catch(UnresolvableException e) { return super.getFunction(null, null, localName); } } };
private void registerExtensionFunctions() { // extension functions should go into a namespace, but which one? // for now, keep them in default namespace to not break any code registerFunction( null, // namespace URI "evaluate", new EvaluateFunction() ); registerFunction( null, // namespace URI "lower-case", new LowerFunction() ); registerFunction( null, // namespace URI "upper-case", new UpperFunction() ); registerFunction( null, // namespace URI "ends-with", new EndsWithFunction() ); }
public static void registerSelfInSimpleContext() { // see http://jaxen.org/extensions.html ((SimpleFunctionContext) XPathFunctionContext.getInstance()).registerFunction(null, "getCommentOn", new GetCommentOnFunction()); }
@Override public Function getFunction(String namespaceURI, String prefix, String localName) throws UnresolvableException { try { return super.getFunction(namespaceURI, prefix, localName); } catch (UnresolvableException e) { return super.getFunction(null, null, localName); } } };
registerFunction( null, // namespace URI "boolean", new BooleanFunction() ); registerFunction( null, // namespace URI "ceiling", new CeilingFunction() ); registerFunction( null, // namespace URI "concat", new ConcatFunction() ); registerFunction( null, // namespace URI "contains", new ContainsFunction() ); registerFunction( null, // namespace URI "count", new CountFunction() ); registerFunction( null, // namespace URI "false", new FalseFunction() ); registerFunction( null, // namespace URI "floor", new FloorFunction() ); registerFunction( null, // namespace URI
public static void registerSelfInSimpleContext() { // see http://jaxen.org/extensions.html ((SimpleFunctionContext) XPathFunctionContext.getInstance()).registerFunction(null, "matches", new MatchesFunction()); }
@Override public Function getFunction(String namespaceURI, String prefix, String localName) throws UnresolvableException { try { return super.getFunction(namespaceURI, prefix, localName); } catch (UnresolvableException e) { return super.getFunction(null, null, localName); } } };
public void register(XPathFunctionContext context) { context.registerFunction(MCRConstants.getStandardNamespace(prefix).getURI(), localName, function); }
public static void registerSelfInSimpleContext() { ((SimpleFunctionContext) XPathFunctionContext.getInstance()).registerFunction(null, "metric", new MetricFunction()); } }
public static void registerSelfInSimpleContext() { ((SimpleFunctionContext) XPathFunctionContext.getInstance()).registerFunction(null, "typeIsExactly", new TypeIsExactlyFunction()); }
public static void registerSelfInSimpleContext() { ((SimpleFunctionContext) XPathFunctionContext.getInstance()).registerFunction(null, "typeof", new TypeOfFunction()); }
public static void registerSelfInSimpleContext() { ((SimpleFunctionContext) XPathFunctionContext.getInstance()).registerFunction(null, "typeIs", new TypeIsFunction()); }
protected ContextSupport getContextSupport() { return new ContextSupport(new SimpleNamespaceContext(), XPathFunctionContext.getInstance(), new SimpleVariableContext(), DocumentNavigator.getInstance()); }
public FilteredFunctionContext(Set<String> illegalFunctions) { this.illegalFunctions = illegalFunctions; base = XPathFunctionContext.getInstance(); }
public static void registerSelfInSimpleContext() { // see http://jaxen.org/extensions.html ((SimpleFunctionContext) XPathFunctionContext.getInstance()).registerFunction(null, "matches", new MatchesFunction()); }