@Override public void source(String systemId) throws XPathExpressionException { inputSource(new InputSource(systemId)); }
private Object evaluate(String expression, Source context, QName returnType) throws XPathException { XPath xpath = createXPath(); if (getNamespaces() != null && !getNamespaces().isEmpty()) { SimpleNamespaceContext namespaceContext = new SimpleNamespaceContext(); namespaceContext.setBindings(getNamespaces()); xpath.setNamespaceContext(namespaceContext); } try { EvaluationCallback callback = new EvaluationCallback(xpath, expression, returnType); TraxUtils.doWithSource(context, callback); return callback.result; } catch (javax.xml.xpath.XPathException ex) { throw new XPathException("Could not evaluate XPath expression [" + expression + "]", ex); } catch (TransformerException ex) { throw new XPathException("Could not transform context to DOM Node", ex); } catch (Exception ex) { throw new XPathException(ex.getMessage(), ex); } }
private Object evaluate(String expression, Source context, QName returnType) throws XPathException { XPath xpath = createXPath(); if (getNamespaces() != null && !getNamespaces().isEmpty()) { SimpleNamespaceContext namespaceContext = new SimpleNamespaceContext(); namespaceContext.setBindings(getNamespaces()); xpath.setNamespaceContext(namespaceContext); } try { EvaluationCallback callback = new EvaluationCallback(xpath, expression, returnType); TraxUtils.doWithSource(context, callback); return callback.result; } catch (javax.xml.xpath.XPathException ex) { throw new XPathException("Could not evaluate XPath expression [" + expression + "]", ex); } catch (TransformerException ex) { throw new XPathException("Could not transform context to DOM Node", ex); } catch (Exception ex) { throw new XPathException(ex.getMessage(), ex); } }
@Override public void saxSource(XMLReader reader, InputSource inputSource) throws XPathExpressionException { inputSource(inputSource); }
@Override public void source(String systemId) throws XPathExpressionException { inputSource(new InputSource(systemId)); }
@Override public void streamSource(Reader reader) throws XPathExpressionException { inputSource(new InputSource(reader)); }
@Override public void staxSource(XMLEventReader eventReader) throws XPathExpressionException, XMLStreamException, TransformerException { Element element = getRootElement(StaxUtils.createCustomStaxSource(eventReader)); domSource(element); }
@Override public void streamSource(Reader reader) throws XPathExpressionException { inputSource(new InputSource(reader)); }
@Override public void streamSource(InputStream inputStream) throws XPathExpressionException { inputSource(new InputSource(inputStream)); }
@Override public void saxSource(XMLReader reader, InputSource inputSource) throws XPathExpressionException { inputSource(inputSource); }
@Override public void staxSource(XMLStreamReader streamReader) throws TransformerException, XPathExpressionException { Element element = getRootElement(StaxUtils.createCustomStaxSource(streamReader)); domSource(element); }
@Override public void staxSource(XMLEventReader eventReader) throws XPathExpressionException, XMLStreamException, TransformerException { Element element = getRootElement(StaxUtils.createCustomStaxSource(eventReader)); domSource(element); }
@Override public void staxSource(XMLStreamReader streamReader) throws TransformerException, XPathExpressionException { Element element = getRootElement(StaxUtils.createCustomStaxSource(streamReader)); domSource(element); }
@Override public void streamSource(InputStream inputStream) throws XPathExpressionException { inputSource(new InputSource(inputStream)); }