/** * Do not think that this returns an iterator for the namespace axis. * It returns an iterator with nodes that belong in a certain namespace, * such as with <xsl:apply-templates select="blob/foo:*"/> * The 'axis' specifies the axis for the base iterator from which the * nodes are taken, while 'ns' specifies the namespace URI type. */ public DTMAxisIterator getNamespaceAxisIterator(int axis, int ns) { DTMAxisIterator iterator = null; if (ns == NO_TYPE) { return EMPTYITERATOR; } else { switch (axis) { case Axis.CHILD: return new NamespaceChildrenIterator(ns); case Axis.ATTRIBUTE: return new NamespaceAttributeIterator(ns); default: return new NamespaceWildcardIterator(axis, ns); } } }
/** * Set start to END should 'close' the iterator, * i.e. subsequent call to next() should return END. * * @param node Sets the root of the iteration. * * @return A DTMAxisIterator set to the start of the iteration. */ public DTMAxisIterator setStartNode(int node) { //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily if (node == DTMDefaultBase.ROOTNODE) { node = getDocument(); } if (_isRestartable) { int nsType = _nsType; _startNode = node; for (node = getFirstAttribute(node); node != END; node = getNextAttribute(node)) { if (getNSType(node) == nsType) { break; } } _currentNode = node; return resetPosition(); } return this; }
/** * Get the next node in the iteration. * * @return The next node handle in the iteration, or END. */ public int next() { int node = _currentNode; int nsType = _nsType; int nextNode; if (node == END) { return END; } for (nextNode = getNextAttribute(node); nextNode != END; nextNode = getNextAttribute(nextNode)) { if (getNSType(nextNode) == nsType) { break; } } _currentNode = nextNode; return returnNode(node); } } // end of NamespaceAttributeIterator
/** * Do not think that this returns an iterator for the namespace axis. * It returns an iterator with nodes that belong in a certain namespace, * such as with <xsl:apply-templates select="blob/foo:*"/> * The 'axis' specifies the axis for the base iterator from which the * nodes are taken, while 'ns' specifies the namespace URI type. */ public DTMAxisIterator getNamespaceAxisIterator(int axis, int ns) { DTMAxisIterator iterator = null; if (ns == NO_TYPE) { return EMPTYITERATOR; } else { switch (axis) { case Axis.CHILD: return new NamespaceChildrenIterator(ns); case Axis.ATTRIBUTE: return new NamespaceAttributeIterator(ns); default: return new NamespaceWildcardIterator(axis, ns); } } }
/** * Do not think that this returns an iterator for the namespace axis. * It returns an iterator with nodes that belong in a certain namespace, * such as with <xsl:apply-templates select="blob/foo:*"/> * The 'axis' specifies the axis for the base iterator from which the * nodes are taken, while 'ns' specifies the namespace URI type. */ public DTMAxisIterator getNamespaceAxisIterator(int axis, int ns) { DTMAxisIterator iterator = null; if (ns == NO_TYPE) { return EMPTYITERATOR; } else { switch (axis) { case Axis.CHILD: return new NamespaceChildrenIterator(ns); case Axis.ATTRIBUTE: return new NamespaceAttributeIterator(ns); default: return new NamespaceWildcardIterator(axis, ns); } } }
/** * Set start to END should 'close' the iterator, * i.e. subsequent call to next() should return END. * * @param node Sets the root of the iteration. * * @return A DTMAxisIterator set to the start of the iteration. */ public DTMAxisIterator setStartNode(int node) { //%HZ%: Added reference to DTMDefaultBase.ROOTNODE back in, temporarily if (node == DTMDefaultBase.ROOTNODE) { node = getDocument(); } if (_isRestartable) { int nsType = _nsType; _startNode = node; for (node = getFirstAttribute(node); node != END; node = getNextAttribute(node)) { if (getNSType(node) == nsType) { break; } } _currentNode = node; return resetPosition(); } return this; }
/** * Get the next node in the iteration. * * @return The next node handle in the iteration, or END. */ public int next() { int node = _currentNode; int nsType = _nsType; int nextNode; if (node == END) { return END; } for (nextNode = getNextAttribute(node); nextNode != END; nextNode = getNextAttribute(nextNode)) { if (getNSType(nextNode) == nsType) { break; } } _currentNode = nextNode; return returnNode(node); } } // end of NamespaceAttributeIterator
/** * Do not think that this returns an iterator for the namespace axis. * It returns an iterator with nodes that belong in a certain namespace, * such as with <xsl:apply-templates select="blob/foo:*"/> * The 'axis' specifies the axis for the base iterator from which the * nodes are taken, while 'ns' specifies the namespace URI type. */ public DTMAxisIterator getNamespaceAxisIterator(int axis, int ns) { DTMAxisIterator iterator = null; if (ns == NO_TYPE) { return EMPTYITERATOR; } else { switch (axis) { case Axis.CHILD: return new NamespaceChildrenIterator(ns); case Axis.ATTRIBUTE: return new NamespaceAttributeIterator(ns); default: return new NamespaceWildcardIterator(axis, ns); } } }