Package org.apache.xalan.xsltc

Examples of org.apache.xalan.xsltc.NodeIterator


     * supported XPath axes (only namespace::) is not supported.
     * Returns a bare-bones iterator that must be initialized
     * with a start node (using iterator.setStartNode()).
     */
    public NodeIterator getAxisIterator(final int axis) {
  NodeIterator iterator = null;

  switch (axis) {
  case Axis.SELF:
      iterator = new SingletonIterator();
      break;
View Full Code Here


    /**
     * Returns the nth descendant of a node
     */
    public NodeIterator getNthDescendant(int type, int n, boolean includeself) {
  NodeIterator source = (type == ELEMENT) ? (NodeIterator)
       new FilterIterator(new DescendantIterator(), getElementFilter())
       : (NodeIterator) new TypedDescendantIterator(type);

  if (includeself) {
      ((NodeIteratorBase)source).includeSelf();
View Full Code Here

      }
      _idAttributes = newAttributes;
  }

  // Get all nodes in the DOM
  final NodeIterator iter = dom.getAxisIterator(Axis.DESCENDANT);
  iter.setStartNode(DOM.ROOTNODE);

  Integer E = new Integer(typeCache = 0);
  Integer A = null;

  while ((node = iter.next()) != NodeIterator.END) {
      // Get the node type of this node
      type = dom.getType(node);
      if (type != typeCache) {
    E = new Integer(typeCache = type);
    A = (Integer)_idAttributes.get(E);
View Full Code Here

    public void setMultiDOMMask(int mask) {
  _multiDOMMask = mask;
    }

    public NodeIterator getChildren(final int node) {
  NodeIterator iterator = _domImpl.getChildren(node);
  if (_filter == null) {
      return iterator.setStartNode(node);
  }
  else {
      iterator = _domImpl.strippingIterator(iterator, getMapping(),
    _filter);
      return iterator.setStartNode(node);
  }
    }
View Full Code Here

    }

    public NodeIterator getTypedChildren(final int type) {
  final short[] reverse = getReverse();

  NodeIterator iterator = _domImpl.getTypedChildren(reverse[type]);
  if (reverse[type] == DOM.TEXT && _filter != null) {
      return _domImpl.strippingIterator(iterator, getMapping(), _filter);
  }
  return iterator;
    }
View Full Code Here

    public NodeIterator getNamespaceAxisIterator(final int axis, final int ns) {
  return _domImpl.getNamespaceAxisIterator(axis, getNSReverse()[ns]);
    }

    public NodeIterator getAxisIterator(final int axis) {
  NodeIterator iterator = _domImpl.getAxisIterator(axis);
  if (_filter != null) {
      return _domImpl.strippingIterator(iterator, getMapping(), _filter);
  }
  return iterator;
    }
View Full Code Here

  }
  return iterator;
    }

    public NodeIterator getTypedAxisIterator(final int axis, final int type) {
  NodeIterator iterator;
  final short[] reverse = getReverse();
  final short[] NSreverse = getNSReverse();

  if (axis == Axis.NAMESPACE) {
      iterator = (type == NO_TYPE || type > NSreverse.length) ?
View Full Code Here

               String value, boolean op) {
  return(new NodeValueIterator(iterator, type, value, op));
    }

    public NodeIterator getNamespaceAxisIterator(final int axis, final int ns) {
  NodeIterator iterator = _adapters[0].getNamespaceAxisIterator(axis,ns);
  return(iterator);
    }
View Full Code Here

      }
      // Otherwise we must create a union iterator, add the nodes from
      // all the DOMs to this iterator, and return the union in the end.
      else if (arg instanceof NodeIterator) {
    UnionIterator union = new UnionIterator(dom);
    NodeIterator iterator = (NodeIterator)arg;
    int node;

    while ((node = iterator.next()) != DOM.NULL) {
        String uri = dom.getNodeValue(node);
        // Get the URI from this node if no xml URI base is set
        if ((xmlURI == null) || xmlURI.equals("")) {
      xmlURI = dom.getDocumentURI(node);
      final int sep = xmlURI.lastIndexOf('/') + 1;
View Full Code Here

  }
  else if (obj instanceof String) {
      return stringToReal((String) obj);
  }
  else if (obj instanceof NodeIterator) {
      NodeIterator iter = (NodeIterator) obj;
      return stringToReal(dom.getNodeValue(iter.reset().next()));
  }
  else if (obj instanceof Node) {
      return stringToReal(dom.getNodeValue(((Node) obj).node));
  }
  else if (obj instanceof DOM) {
View Full Code Here

TOP

Related Classes of org.apache.xalan.xsltc.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.