Examples of XResult


Examples of com.ibm.commons.xml.XResult

   * This method returns a list of nodes from an XPathExpression
   */
  private String[] getAsArray(XPathExpression xpathExpression) {
    String[] results = null;
    if (data instanceof Node) {
      XResult xresult = null;
      try {
        xresult = getEntryResults(data, xpathExpression);
      } catch (XPathException e) {
      }
      results = xresult.getValues();
    }
    return results;
  }
View Full Code Here

Examples of com.ibm.commons.xml.XResult

   */
  private List<Node> getEntries(XPathExpression xpathExpression) {
    List<Node> entries = new ArrayList<Node>();
    List<Object> results = null;
    if (data instanceof Node) {
      XResult xresult = null;
      try {
        xresult = getEntryResults(data, xpathExpression);
      } catch (XPathException e) {
      }
      results = Arrays.asList(xresult.getNodes());
      for (Object result : results) {
        entries.add((Node) result);
      }
    }

View Full Code Here

Examples of com.ibm.commons.xml.XResult

   *
   * @return xresult
   */
  protected XResult getEntryResults(Node data, XPathExpression xpathExpression)
      throws XPathException {
    XResult xresult = null;
    xresult = xpathExpression.eval(data, nameSpaceCtx);
    return xresult;
  }
View Full Code Here

Examples of com.ibm.commons.xml.XResult

   *
   * @return Execute xpath query
   */
  public String getStringValue(XPathExpression xpathQuery) {
    try {
      XResult xresult = xpathQuery.eval(data, nameSpaceCtx);
      return xresult.getStringValue();
    } catch (XPathException e) {
    } catch (XMLException e) {
    }
    return null;
  }
View Full Code Here

Examples of com.ibm.commons.xml.XResult

   *
   * @return Execute xpath query
   */
  public Date getDateValue(XPathExpression xpathQuery) {
    try {
      XResult xresult = xpathQuery.eval(data, nameSpaceCtx);
      return xresult.getDateValue();
    } catch (XPathException e) {
    } catch (XMLException e) {
    }
    return null;
  }
View Full Code Here

Examples of com.ibm.commons.xml.XResult

   *
   * @return Execute xpath query
   */
  public boolean getBooleanValue(XPathExpression xpathQuery) {
    try {
      XResult xresult = xpathQuery.eval(data, nameSpaceCtx);
      return xresult.getBooleanValue();
    } catch (XPathException e) {
    } catch (XMLException e) {
    }
    return false;
  }
View Full Code Here

Examples of com.ibm.commons.xml.XResult

   *
   * @return Execute xpath query
   */
  public double getNumberValue(XPathExpression xpathQuery) {
    try {
      XResult xresult = xpathQuery.eval(data, nameSpaceCtx);
      return xresult.getNumberValue();
    } catch (XPathException e) {
    } catch (XMLException e) {
    }
    return 0;
  }
View Full Code Here

Examples of com.ibm.commons.xml.XResult

   *
   * @return Execute xpath query
   */
  public String getFieldUsingXPath(XPathExpression xpathQuery) {
    try {
      XResult xresult = xpathQuery.eval(data, nameSpaceCtx);
      return xresult.getStringValue();
    } catch (XPathException e) {
      // TODO Add Logging
    } catch (XMLException e) {
      // TODO Add Logging
    }
View Full Code Here

Examples of com.ibm.commons.xml.XResult

    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));
      } else if ("link".equals(type)) {
View Full Code Here

Examples of com.ibm.commons.xml.XResult

        }
    }
    public XResult evaluateXPath(NodeList nodeList, Object xpath, NamespaceContext nsContext) throws XPathException {
        try {
            if(nodeList.getLength()>0) {
                XResult result = null;
                NodeListImpl nodes = null;
                PrefixResolver pr = nsContext!=null ? new NSResolver(nsContext) : null;
                for( int i=0; i<nodeList.getLength(); i++ ) {
                    XObject res = XPathAPI.eval(nodeList.item(i),(String)xpath,pr);
                    switch(res.getType()) {
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.