} else if (((nsarray[i]>>16) & 0xffff) == 0) { NamespaceIterator.NamespaceNodeImpl nn = new NamespaceIterator.NamespaceNodeImpl(parent, nsarray[i], i+1); return NodeOverNodeInfo.wrap(nn); if (prefix.equals("xml")) { NamespaceIterator.NamespaceNodeImpl nn = new NamespaceIterator.NamespaceNodeImpl(parent, NamespaceConstant.XML_CODE, 0); return NodeOverNodeInfo.wrap(nn); } else if (prefix.equals(parent.getNamePool().getPrefixFromNamespaceCode(nsarray[i]))) { NamespaceIterator.NamespaceNodeImpl nn = new NamespaceIterator.NamespaceNodeImpl(parent, nsarray[i], i+1); return NodeOverNodeInfo.wrap(nn);
NodeInfo ns = new NamespaceNodeImpl(element, NamespaceConstant.XML_NAMESPACE_CODE, 0); if (test == null) { return SingleNodeIterator.makeIterator(ns);
NodeInfo ns = new NamespaceNodeImpl(element, NamespaceConstant.XML_NAMESPACE_CODE, 0); if (test == null) { return SingleNodeIterator.makeIterator(ns);
new NamespaceIterator.NamespaceNodeImpl(parent, NamespaceConstant.XML_NAMESPACE_CODE, 0); return NodeOverNodeInfo.wrap(nn); int nscode = nsList[index-1]; NamespaceIterator.NamespaceNodeImpl nn = new NamespaceIterator.NamespaceNodeImpl(parent, nscode, index); return NodeOverNodeInfo.wrap(nn);
/** * Get the typed value. The result of this method will always be consistent with the method * {@link Item#getTypedValue()}. However, this method is often more convenient and may be * more efficient, especially in the common case where the value is expected to be a singleton. * * @return the typed value. If requireSingleton is set to true, the result will always be an * AtomicValue. In other cases it may be a Value representing a sequence whose items are atomic * values. * @since 8.5 */ public Value atomize() throws XPathException { return new StringValue(getStringValueCS()); } }
/** * Get the next item in the sequence. */ public void advance() { while (nsIterator.hasNext()) { int nscode = nsIterator.next(); next = new NamespaceNodeImpl(element, nscode, ++index); if (test == null || test.matches(next)) { return; } } next = null; }
/** * Get the next item in the sequence. */ public void advance() { while (nsIterator.hasNext()) { int nscode = nsIterator.next(); next = new NamespaceNodeImpl(element, nscode, ++index); if (test == null || test.matches(next)) { return; } } next = null; }
/** * Get the typed value. The result of this method will always be consistent with the method * {@link Item#getTypedValue()}. However, this method is often more convenient and may be * more efficient, especially in the common case where the value is expected to be a singleton. * * @return the typed value. If requireSingleton is set to true, the result will always be an * AtomicValue. In other cases it may be a Value representing a sequence whose items are atomic * values. * @since 8.5 */ public Value atomize() throws XPathException { return new StringValue(getStringValueCS()); }
/** * Return an iteration over all the nodes reached by the given axis from this node * * @param axisNumber an integer identifying the axis; one of the constants * defined in class net.sf.saxon.om.Axis * @return an AxisIterator that scans the nodes reached by the axis in * turn. * @throws UnsupportedOperationException if the namespace axis is * requested and this axis is not supported for this implementation. * @see Axis */ public AxisIterator iterateAxis(byte axisNumber) { return iterateAxis(axisNumber, AnyNodeTest.getInstance()); }
/** * The equals() method compares nodes for identity. It is defined to give the same result * as isSameNodeInfo(). * @param other the node to be compared with this node * @return true if this NodeInfo object and the supplied NodeInfo object represent * the same node in the tree. * @since 8.7 Previously, the effect of the equals() method was not defined. Callers * should therefore be aware that third party implementations of the NodeInfo interface may * not implement the correct semantics. It is safer to use isSameNodeInfo() for this reason. * The equals() method has been defined because it is useful in contexts such as a Java Set or HashMap. */ public boolean equals(Object other) { return other instanceof NodeInfo && isSameNodeInfo((NodeInfo)other); }
/** * Return the atomized value of the current node. * * @return the atomized value. * @throws NullPointerException if there is no current node */ public Value atomize() throws XPathException { return current.atomize(); }
/** * Return an iteration over all the nodes reached by the given axis from this node * * @param axisNumber an integer identifying the axis; one of the constants * defined in class net.sf.saxon.om.Axis * @return an AxisIterator that scans the nodes reached by the axis in * turn. * @throws UnsupportedOperationException if the namespace axis is * requested and this axis is not supported for this implementation. * @see Axis */ public AxisIterator iterateAxis(byte axisNumber) { return iterateAxis(axisNumber, AnyNodeTest.getInstance()); }
/** * The equals() method compares nodes for identity. It is defined to give the same result * as isSameNodeInfo(). * @param other the node to be compared with this node * @return true if this NodeInfo object and the supplied NodeInfo object represent * the same node in the tree. * @since 8.7 Previously, the effect of the equals() method was not defined. Callers * should therefore be aware that third party implementations of the NodeInfo interface may * not implement the correct semantics. It is safer to use isSameNodeInfo() for this reason. * The equals() method has been defined because it is useful in contexts such as a Java Set or HashMap. */ public boolean equals(Object other) { return other instanceof NodeInfo && isSameNodeInfo((NodeInfo)other); }
/** * Get the typed value of the item * * @return the typed value of the item. In general this will be a sequence * @throws net.sf.saxon.trans.XPathException * where no typed value is available, e.g. for * an element with complex content */ public SequenceIterator getTypedValue() throws XPathException { return SingletonIterator.makeIterator(new StringValue(getStringValueCS())); }
/** * Return the string value of the current node. * * @return the string value, as an instance of CharSequence. * @throws NullPointerException if there is no current node */ public CharSequence getStringValue() { return current.getStringValueCS(); }
/** * Return an iterator over an axis, starting at the current node. * * @param axis the axis to iterate over, using a constant such as * {@link Axis#CHILD} * @param test a predicate to apply to the nodes before returning them. * @throws NullPointerException if there is no current node */ public AxisIterator iterateAxis(byte axis, NodeTest test) { return current.iterateAxis(axis, test); }
/** * Get the value of the item as a CharSequence. This is in some cases more efficient than * the version of the method that returns a String. */ public CharSequence getStringValueCS() { return getStringValue(); }
/** * Get the typed value of the item * * @return the typed value of the item. In general this will be a sequence * @throws net.sf.saxon.trans.XPathException * where no typed value is available, e.g. for * an element with complex content */ public SequenceIterator getTypedValue() throws XPathException { return SingletonIterator.makeIterator(new StringValue(getStringValueCS())); }
/** * Get the value of the item as a CharSequence. This is in some cases more efficient than * the version of the method that returns a String. */ public CharSequence getStringValueCS() { return getStringValue(); }
/** * Get the display name of this node. For elements and attributes this is [prefix:]localname. * For unnamed nodes, it is an empty string. * * @return The display name of this node. For a node with no name, return * an empty string. */ public String getDisplayName() { return getLocalPart(); }