Package com.ibm.commons.xml.xpath

Examples of com.ibm.commons.xml.xpath.XPathExpression.eval()


      logger.entering(sourceClass, "get");
    }
    String result = "";
    try {
      XPathExpression xpathQuery = getXPathQuery(fieldName);
      XResult xResult = xpathQuery.eval(data, getNamespaceContext());
      result = xResult.getStringValue() != null ? xResult.getStringValue() : "";
    } catch (XPathException e) {
      logger.throwing(sourceClass, "get", e);
    } catch (XMLException e) {
      logger.throwing(sourceClass, "get", e);
View Full Code Here


      logger.entering(sourceClass, "getEntities");
    }
    XPathExpression xpathQuery = getXPathQuery(namedQuery);

    try {
      XResult xResult = xpathQuery.eval(data, getNamespaceContext());
      // forcing erasure, as getNodes returns an array of objects
      List l = Arrays.asList(xResult.getNodes());;
      return l;
    } catch (XPathException e) {
      logger.throwing(sourceClass, "getNestedEntities", e);
View Full Code Here

    List<Field> fields = new ArrayList<Field>();
    for (Node node : nodeFields) {
      XPathExpression xpath = (node instanceof Document) ? (XPathExpression)ActivityXPath.field.getPath() : null;
     
      XPathExpression fieldType = ActivityXPath.field_type.getPath();
      XResult result = fieldType.eval(node, nameSpaceCtx);
      String type = result.getStringValue();
      if ("date".equals(type)) {
        fields.add(new DateField(activityService, node, nameSpaceCtx, xpath));
      } else if ("file".equals(type)) {
        fields.add(new FileField(activityService, node, nameSpaceCtx, xpath));
View Full Code Here

     * @return the result of the XPath evaluation
     * @throws XMLException
     */
    public static XResult evaluateXPath(Node node, String xpathExpr, NamespaceContext nsContext, boolean useCache) throws XMLException {
        XPathExpression expr = createXPath(xpathExpr,useCache);
        return expr.eval(node,nsContext);
    }

    /**
     * Evaluate an XPath expression.
     * This object can be safetly reused for subsequent evaluations.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.