Package dk.brics.xact

Examples of dk.brics.xact.XMLXPathException


      MyNavigator nav = new MyNavigator(root);
      for (Object s : selected)
        res.add(StringFunction.evaluate(s, nav));
      return Collections.unmodifiableList(res);
    } catch (JaxenException e) {
      throw new XMLXPathException(e);
    } catch (JaxenRuntimeException e) {
      throw new XMLXPathException(e.getCause());
    }
  }
View Full Code Here


    try {
      ElementWrapper root = makeRoot(context);
      List<Object> s = new ArrayList<Object>();
      Object n = prepare(xpath, root).selectSingleNode(root.getFirstChild());
      if (n == null)
        throw new XMLXPathException("no node selected");
      s.add(n);
      List<Node> sel = copyNodes(root, s, remove_successors);
      if (sel.isEmpty()) // root is removed by copyNodes if selected
        throw new XMLXPathException("no node selected");
      return new NodeResult(getRealFirstChild(root), sel.get(0));
    } catch (JaxenException e) {
      throw new XMLXPathException(e);
    } catch (JaxenRuntimeException e) {
      throw new XMLXPathException(e.getCause());
    }
  }
View Full Code Here

  public static String stringValueOf(XML context, String xpath) {
    try {
      ElementWrapper root = makeRoot(context);
      return prepare(xpath, root).stringValueOf(root.getFirstChild());
    } catch (JaxenException e) {
      throw new XMLXPathException(e);
    } catch (JaxenRuntimeException e) {
      throw new XMLXPathException(e.getCause());
    }
  }
View Full Code Here

  public static boolean booleanValueOf(XML context, String xpath) {
    try {
      ElementWrapper root = makeRoot(context);
      return prepare(xpath, root).booleanValueOf(root.getFirstChild());
    } catch (JaxenException e) {
      throw new XMLXPathException(e);
    } catch (JaxenRuntimeException e) {
      throw new XMLXPathException(e.getCause());
    }
  }
View Full Code Here

  public static Number numberValueOf(XML context, String xpath) {
    try {
      ElementWrapper root = makeRoot(context);
      return prepare(xpath, root).numberValueOf(root.getFirstChild());
    } catch (JaxenException e) {
      throw new XMLXPathException(e);
    } catch (JaxenRuntimeException e) {
      throw new XMLXPathException(e.getCause());
    }
  }
View Full Code Here

          return ns;
        }}
      );
      return xp;
    } catch (SAXPathException e) {
      throw new XMLXPathException("XPath error", e);
    }
  }
View Full Code Here

      ElementWrapper root = makeRoot(context);
      List<?> selected = prepare(xpath, root).selectNodes(root.getFirstChild())// apparently, jaxen doesn't use deep recursive calls
      List<Node> sel = copyNodes(root, selected, remove_successors);
      return new NodeListResult(getRealFirstChild(root), sel);
    } catch (JaxenException e) {
      throw new XMLXPathException(e);
    } catch (JaxenRuntimeException e) {
      throw new XMLXPathException(e.getCause());
    }
  }
View Full Code Here

      xpath = "/node()|/@*";
    }
    try {
      return evaluator.evaluate(g, xpath, dummy_root, dummy_root_content);
    } catch (Exception ex) {
      throw new XMLXPathException(ex);
    }
   
  }
View Full Code Here

TOP

Related Classes of dk.brics.xact.XMLXPathException

Copyright © 2018 www.massapicom. 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.