throw new SAXPathException( "Class [" + className + "] does not implement the org.jaxen.saxpath.XPathReader interface." ); throw new SAXPathException( e ); throw new SAXPathException( e ); throw new SAXPathException( e );
/** Print this exception's stack trace, followed by the * source exception's stack trace, if any. * * @param s the writer on which to print the stack trace */ public void printStackTrace ( PrintWriter s ) { super.printStackTrace( s ); if (javaVersion < 1.4 && getCause() != null) { s.print( "Caused by: " ); getCause().printStackTrace( s ); } }
/** * Create a new SAXPathException with the specified detail message * and root cause. * * @param message the detail message * @param cause the cause of this exception */ public SAXPathException(String message, Throwable cause) { super( message ); initCause(cause); }
public XPathPattern(String text) { this.text = text; this.context = new Context(getContextSupport()); try { this.pattern = PatternParser.parse(text); } catch (SAXPathException e) { throw new InvalidXPathException(text, e.getMessage()); } catch (RuntimeException e) { throw new InvalidXPathException(text); } }
public static List evaluate (Context context, Object arg) throws FunctionCallException { List contextNodes = context.getNodeSet(); if (contextNodes.size() == 0) return Collections.EMPTY_LIST; Navigator nav = context.getNavigator(); String xpathString; if ( arg instanceof String ) xpathString = (String)arg; else xpathString = StringFunction.evaluate(arg, nav); try { XPath xpath = nav.parseXPath(xpathString); ContextSupport support = context.getContextSupport(); xpath.setVariableContext( support.getVariableContext() ); xpath.setFunctionContext( support.getFunctionContext() ); xpath.setNamespaceContext( support.getNamespaceContext() ); return xpath.selectNodes( context.duplicate() ); } catch ( org.jaxen.saxpath.SAXPathException e ) { throw new FunctionCallException(e.toString()); } } }
public XPathPattern(String text) { this.text = text; this.context = new Context(getContextSupport()); try { this.pattern = PatternParser.parse(text); } catch (SAXPathException e) { throw new InvalidXPathException(text, e.getMessage()); } catch (RuntimeException e) { throw new InvalidXPathException(text); } }
public static String getNamespace(String nsPrefix, Properties namespaces) throws SAXPathException { String namespace = namespaces.getProperty(nsPrefix); if(namespace == null) { namespace = Namespace.SMOOKS_PREFIX_MAPPINGS.getProperty(nsPrefix); if(namespace == null) { throw new SAXPathException("Unknown namespace prefix '" + nsPrefix + "'. You must define the namespace prefix-to-uri mappings in the Smooks <core:namespaces> configuration section."); } } return namespace; } }
public XPathPattern(String text) { this.text = text; this.context = new Context(getContextSupport()); try { this.pattern = PatternParser.parse(text); } catch (SAXPathException e) { throw new InvalidXPathException(text, e.getMessage()); } catch (Throwable t) { throw new InvalidXPathException(text, t); } }
/** Create a new SAXPathException based on another exception * * @param cause the error source */ public SAXPathException(Throwable cause) { super ( cause.getMessage() ); initCause(cause); }
/** Print this exception's stack trace, followed by the * source exception's trace, if any. * * @param s the stream on which to print the stack trace */ public void printStackTrace ( PrintStream s ) { super.printStackTrace ( s ); if (javaVersion < 1.4 && getCause() != null) { s.print( "Caused by: " ); getCause().printStackTrace( s ); } }
public static String getNamespace(String nsPrefix, Properties namespaces) throws SAXPathException { String namespace = namespaces.getProperty(nsPrefix); if(namespace == null) { namespace = Namespace.SMOOKS_PREFIX_MAPPINGS.getProperty(nsPrefix); if(namespace == null) { throw new SAXPathException("Unknown namespace prefix '" + nsPrefix + "'. You must define the namespace prefix-to-uri mappings in the Smooks <core:namespaces> configuration section."); } } return namespace; } }
public XPathPattern(String text) { this.text = text; this.context = new Context(getContextSupport()); try { this.pattern = PatternParser.parse(text); } catch (SAXPathException e) { throw new InvalidXPathException(text, e.getMessage()); } catch (Throwable t) { throw new InvalidXPathException(text, t); } }
public static String getNamespace(String nsPrefix, Properties namespaces) throws SAXPathException { String namespace = namespaces.getProperty(nsPrefix); if(namespace == null) { namespace = Namespace.SMOOKS_PREFIX_MAPPINGS.getProperty(nsPrefix); if(namespace == null) { throw new SAXPathException("Unknown namespace prefix '" + nsPrefix + "'. You must define the namespace prefix-to-uri mappings in the Smooks <core:namespaces> configuration section."); } } return namespace; } }
public XPathPattern(String text) { this.text = text; this.context = new Context(getContextSupport()); try { this.pattern = PatternParser.parse(text); } catch (SAXPathException e) { throw new InvalidXPathException(text, e.getMessage()); } catch (Throwable t) { throw new InvalidXPathException(text, t); } }
public static String getNamespace(String nsPrefix, Properties namespaces) throws SAXPathException { String namespace = namespaces.getProperty(nsPrefix); if(namespace == null) { namespace = Namespace.SMOOKS_PREFIX_MAPPINGS.getProperty(nsPrefix); if(namespace == null) { throw new SAXPathException("Unknown namespace prefix '" + nsPrefix + "'. You must define the namespace prefix-to-uri mappings in the Smooks <core:namespaces> configuration section."); } } return namespace; } }
public XPathPattern(String text) { this.text = text; this.context = new Context(getContextSupport()); try { this.pattern = PatternParser.parse(text); } catch (SAXPathException e) { throw new InvalidXPathException(text, e.getMessage()); } catch (Throwable t) { throw new InvalidXPathException(text, t); } }
public static String getNamespace(String nsPrefix, Properties namespaces) throws SAXPathException { String namespace = namespaces.getProperty(nsPrefix); if(namespace == null) { namespace = Namespace.SMOOKS_PREFIX_MAPPINGS.getProperty(nsPrefix); if(namespace == null) { throw new SAXPathException("Unknown namespace prefix '" + nsPrefix + "'. You must define the namespace prefix-to-uri mappings in the Smooks <core:namespaces> configuration section."); } } return namespace; } }
public XPathPattern(String text) { this.text = text; this.context = new Context(getContextSupport()); try { this.pattern = PatternParser.parse(text); } catch (SAXPathException e) { throw new InvalidXPathException(text, e.getMessage()); } catch (Throwable t) { throw new InvalidXPathException(text, t); } }
/** * Set the namespaces on the specified set of selector steps. * @param steps The selector steps. * @param namespaces The set of selector steps to be updated. * @return The set of selector steps (as passed in the 'steps' argument). * @throws org.jaxen.saxpath.SAXPathException Error setting namespaces */ public static SelectorStep[] setNamespaces(SelectorStep[] steps, Properties namespaces) throws SAXPathException { AssertArgument.isNotNull(steps, "steps"); AssertArgument.isNotNull(namespaces, "namespaces"); for(int i = 0; i < steps.length; i++) { SelectorStep step = steps[i]; try { step.buildPredicatesEvaluator(namespaces); } catch (SAXPathException e) { throw e; } catch (Exception e) { throw new SAXPathException("Error compiling PredicatesEvaluator.", e); } // if(i < steps.length - 1 && step.accessesText()) { throw new SAXPathException("Unsupported XPath selector expression '" + step.getXPathExpression() + "'. XPath 'text()' tokens are only supported in the last step."); } } return steps; }
public XPathPattern(String text) { this.text = text; this.context = new Context(getContextSupport()); try { this.pattern = PatternParser.parse(text); } catch (SAXPathException e) { throw new InvalidXPathException(text, e.getMessage()); } catch (Throwable t) { throw new InvalidXPathException(text, t); } }