Package com.caucho.xpath.pattern

Examples of com.caucho.xpath.pattern.NodeIterator


   * @return the string representation of the expression.
   */
  public String evalString(Node node, ExprEnvironment env)
    throws XPathException
  {
    NodeIterator iter = _expr.evalNodeSet(node, env);

    Node result = iter.next();

    return QAbstractNode.baseURI(result);
  }
View Full Code Here


    throws XPathException
  {
    Object value = _expr.evalObject(node, env);

    if (value instanceof NodeIterator) {
      NodeIterator iter = (NodeIterator) value;

      while (iter.hasNext()) {
        Node subnode = iter.next();

        XmlPrinter printer = new XmlPrinter(System.out);

        try {
          printer.printPrettyXml(subnode);
View Full Code Here

    Env env = XPath.createEnv();

    env.setCurrentNode(node);
   
    NodeIterator iter = pattern.select(node, env);

    XPath.freeEnv(env);

    return iter;
  }
View Full Code Here

    if (_contextNode == null || _currentNode == null)
      return 0;

    if (_select != null) {
      try {
        NodeIterator iter = _select.select(_contextNode, this);
        Node child;
     
        while ((child = iter.nextNode()) != null && child != _currentNode) {
        }

        return iter.getContextPosition();
      } catch (Exception e) {
      }
    }

    Node child = _contextNode.getFirstChild();
View Full Code Here

    if (_contextNode == null || _currentNode == null)
      return 0;

    if (_select != null) {
      try {
        NodeIterator iter = _select.select(_contextNode, this);
        Node child;
     
        while ((child = iter.nextNode()) != null && child != _currentNode) {
        }

        return iter.getContextSize();
      } catch (Exception e) {
      }
    }

    Node child = _contextNode.getFirstChild();
View Full Code Here

  {
    Env env = XPath.createEnv();
    env.setCurrentNode(node);
    env.setContextNode(node);

    NodeIterator result = evalNodeSet(node, env);

    XPath.freeEnv(env);

    return result;
  }
View Full Code Here

   * @return true if the node exists
   */
  public String evalString(Node node, ExprEnvironment env)
    throws XPathException
  {
    NodeIterator iter = evalNodeSet(node, env);

    if (! iter.hasNext())
      return "";

    Node qNode = (Node) iter.next();
    return XmlUtil.textValue(qNode);
  }
View Full Code Here

     * @return the string representation of the expression.
     */
    public String evalString(Node node, ExprEnvironment env)
      throws XPathException
    {
      NodeIterator iter = _expr.evalNodeSet(node, env);

      Node result = iter.next();

      return QAbstractNode.baseURI(result);
    }
View Full Code Here

TOP

Related Classes of com.caucho.xpath.pattern.NodeIterator

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.