} else { Node n = xpathField.selectSingleNode( node ); if ( n != null ) { nodevalue = n.asXML();
public Node selectSingleNode(String xpathExpression) { XPath xpath = createXPath(xpathExpression); return xpath.selectSingleNode(this); }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
public boolean hasElement( String xpathExpr ) throws XMLException { XPath xpath = createXPath( xpathExpr ); Object evaluated = xpath.selectSingleNode( document ); if ( evaluated == null ) { return false; } return true; }
public Node selectSingleNode(String xpathExpression) { XPath xpath = createXPath(xpathExpression); return xpath.selectSingleNode(this); }
public Node selectSingleNode(String xpathExpression) { XPath xpath = createXPath(xpathExpression); return xpath.selectSingleNode(this); }
public Node selectSingleNode(String xpathExpression) { XPath xpath = createXPath(xpathExpression); return xpath.selectSingleNode(this); }
/** * Selects a single node that matches the given XPath. * * @param xpathExpression the xpath * * @return a single <code>Node</code> or <code>null</code> if no match */ public Node selectSingleNode(String xpathExpression) { XPath xpath = createXPath(xpathExpression); return xpath.selectSingleNode(node); }
public boolean hasElement( String xpathExpr ) throws XMLException { XPath xpath = createXPath( xpathExpr ); Object evaluated = xpath.selectSingleNode( document ); if ( evaluated == null ) { return false; } return true; }
public boolean hasElement( String xpathExpr ) throws XMLException { XPath xpath = createXPath( xpathExpr ); Object evaluated = xpath.selectSingleNode( document ); if ( evaluated == null ) { return false; } return true; }
/** * Executes the specified namespace aware XPath query as a single node query, returning the resulting single node. */ public static Node selectSingleNode(Node node, String xpathQuery, Map<String, String> namespaceUris) { XPath xpath = DocumentHelper.createXPath(xpathQuery); xpath.setNamespaceURIs(namespaceUris); return xpath.selectSingleNode(node); }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
public Object getValue(Object row) { switch (type) { case STRING_TYPE: return xpath.valueOf(row); case NUMBER_TYPE: return xpath.numberValueOf(row); case NODE_TYPE: return xpath.selectSingleNode(row); default: return xpath.evaluate(row); } }
public void testURIMap() throws Exception { Map<String, String> uris = new HashMap<String, String>(); uris.put("SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/"); uris.put("m", "urn:xmethodsBabelFish"); String path = "/SOAP-ENV:Envelope/SOAP-ENV:Body/m:BabelFish"; XPath xpath = document.createXPath(path); xpath.setNamespaceURIs(uris); Node babelfish = xpath.selectSingleNode(document); // log( "Found: " + babelfish ); assertNotNull("Found valid node", babelfish); }
public Object evaluate(TaskRequest req, TaskResponse res) { Node src = (Node) source.evaluate(req, res); final String xpathExpresion = (String) this.xpath.evaluate(req, res); final XPath xpath = this.xpathCache.getCachedObject(req, res, xpathExpresion, XPathCacheFactory.INSTANCE); try { xpath.setVariableContext(new RequestVariableContext(req)); return xpath.selectSingleNode(src); } finally { xpath.setVariableContext(null); } }