Evaluate the result of executing the specified xpath syntax
<code>select</code> expression on the specified document
@param select
@param document
@return evaluated result
3646
public String evaluate(String select, Document document)
        throws ConfigurationException, XpathException {
        try {
            StringWriter writer = new StringWriter();
            StreamResult result = new StreamResult(writer);
            performTransform(getValueTransformation(select), document, result);
            return writer.toString();
        } catch (TransformerException ex) {
            throw new XpathException("Failed to apply stylesheet", ex);
        }
    }
1145635
function xpathEval(select, context, ns) {
    var str = select;
    if (ns !== undefined) {
        if (context.node)
            str = context.node.prepare(select, ns);
    }
    //parse statement
    var expr = xpathParse(str);
    //and return value
    return expr.evaluate(context);
}
592972
public static Node asNode(String nodeName, Node node, XPath xpath)
            throws XPathExpressionException {
        if (node == null) return null;
        return (Node) xpath.evaluate(nodeName, node, XPathConstants.NODE);
    }
996774
public static <T> JPQLQuery<T> select(Expression<T> expr) {
        return new JPASubQuery<Void>().select(expr);
    }
978003
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
  {

    int whereNode = getArg0AsNode(xctxt);
    String fileLocation = null;

    if (DTM.NULL != whereNode)
    {
      DTM dtm = xctxt.getDTM(whereNode);
      
      // %REVIEW%
      if (DTM.DOCUMENT_FRAGMENT_NODE ==  dtm.getNodeType(whereNode))
      {
        whereNode = dtm.getFirstChild(whereNode);
      }

      if (DTM.NULL != whereNode)
      {        
        fileLocation = dtm.getDocumentBaseURI();
//        int owner = dtm.getDocument();
//        fileLocation = xctxt.getSourceTreeManager().findURIFromDoc(owner);
      }
    }

    return new XString((null != fileLocation) ? fileLocation : "");
  }
690359
public java.lang.String getOnselect() {
        return (java.lang.String) getStateHelper().eval(PropertyKeys.onselect);

    }
1248927
public static String evaluate(String xpath, String html) throws XPathExpressionException,
            ParserConfigurationException {
        HtmlCleaner hc = new HtmlCleaner();
        TagNode tn = hc.clean(html);
        Document document = new DomSerializer(new CleanerProperties()).createDOM(tn);
        XPath xPath = XPathFactory.newInstance().newXPath();
        return xPath.evaluate(xpath, document);
    }
344958
public static Node selectSingleNode(Node node, String xpathQuery, Map<String, String> namespaceUris) {
        XPath xpath = DocumentHelper.createXPath(xpathQuery);
        xpath.setNamespaceURIs(namespaceUris);

        return xpath.selectSingleNode(node);
    }
118961
private NodeList getNodeList(String document, XPathExpression expression) throws Exception
   {
      Document doc = m_documentBuilder.parse(new InputSource(new StringReader(document)));
      return (NodeList) expression.evaluate(doc, XPathConstants.NODESET);
   }
256495
public static NodeList evaluateAsNodeList(Node node, String xPathExpression, NamespaceContext nsContext) {
        NodeList result = (NodeList) evaluateExpression(node, xPathExpression, nsContext, XPathConstants.NODESET);

        if (result == null) {
            throw new CitrusRuntimeException("No result for XPath expression: '" + xPathExpression + "'");
        }

        return result;
    }
787809
public static Elements select(Evaluator evaluator, Element root) {
        Validate.notNull(evaluator);
        Validate.notNull(root);
        return Collector.collect(evaluator, root);
    }
292710
public static Element toElement(Document doc, Object o) throws PageException {
	if (o instanceof Element) return (Element) o;
	else if (o instanceof Node) throw new ExpressionException("Object " + Caster.toClassName(o) + " must be a XML Element");
	return doc.createElement(Caster.toString(o));
    }
638093
public static Document getResultSetAsXML(ResultSet rs, String tableName, String keyName) throws Exception {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        Document doc = builder.newDocument();
        Element results = doc.createElement("Results");
        doc.appendChild(results);

        ResultSetMetaData rsmd = rs.getMetaData();
        // add the name of the table
        Element tableNameElement = doc.createElement("table");
        tableNameElement.setAttribute("name", tableName);
        tableNameElement.setAttribute("key", keyName);
        results.appendChild(tableNameElement);

        int colCount = rsmd.getColumnCount();

        while (rs.next()) {
            Element row = doc.createElement("Row");
            tableNameElement.appendChild(row);
            for (int i = 1; i <= colCount; i++) {
                String columnName = rsmd.getColumnName(i);
                Object value = rs.getObject(i);
                // If the value is null, don't put it in the XML Document
                if (value != null) {
                    String colType = rsmd.getColumnTypeName(i);
                    Element node = doc.createElement(columnName);
                    if (colType.equals("bytea")) {
                        String byteaStr = "";
                        byte[] imgBytes = rs.getBytes(i);
                        for (int byteIndex = 0; byteIndex < imgBytes.length; byteIndex++) {
                            if (byteIndex != 0) {
                                byteaStr = byteaStr + ";" + Byte.toString(imgBytes[byteIndex]);
                            } else {
                                byteaStr = Byte.toString(imgBytes[byteIndex]);
                            }
                        }
                        node.appendChild(doc.createTextNode(byteaStr));
                    } else {
                        node.appendChild(doc.createTextNode(value.toString()));
                    }
                    row.appendChild(node);
                }
            }
        }
        return doc;
    }
818358
public String execute( String xPath ) throws Exception {

		if ( xPath == null ){
			return null;
		}
		
		// Evaluate the xpath expression
		return XPathAPI.eval( getDoc(), xPath ).toString();
		
	
	}
669047
public static Node getElement(Node node, String xExpr, XPath xPath) throws XPathExpressionException {
        return (Node) xPath.compile(xExpr).evaluate(node, XPathConstants.NODE);
    }
1269752
public @Nonnull Stream<XQuery> select(String xpath) {
        return new NodeListSpliterator(evaluate(xpath)).stream().map(XQuery::new);
    }
575551
public final void mSELECT() throws RecognitionException {
		try {
			int _type = SELECT;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// hql.g:58:8: ( 'select' )
			// hql.g:58:10: 'select'
			{
			match("select"); if (state.failed) return;

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}