public NodeInfo mapItem(NodeInfo item) { if (Navigator.isAncestorOrSelf(origin, item)) { return item; } else { return null; } }
/** * Ask whether a node in the source tree is within the scope of this virtual copy * @param sourceNode the node being tested * @return true if the node is within the scope of the subtree */ protected boolean isIncludedInCopy(NodeInfo sourceNode) { return Navigator.isAncestorOrSelf(root, sourceNode); }
/** * Ask whether a node in the source tree is within the scope of this virtual copy * @param sourceNode the node being tested * @return true if the node is within the scope of the subtree */ protected boolean isIncludedInCopy(NodeInfo sourceNode) { return Navigator.isAncestorOrSelf(root, sourceNode); }
public NodeInfo mapItem(NodeInfo item) { if (Navigator.isAncestorOrSelf(origin, item)) { return item; } else { return null; } }
public NodeInfo next() throws XPathException { while (true) { NodeInfo next = (NodeInfo)in.next(); if (next == null) { current = null; position = -1; return null; } if (current == null || !Navigator.isAncestorOrSelf(current, next)) { current = next; position++; return current; } } }
public NodeInfo next() throws XPathException { while (true) { NodeInfo next = (NodeInfo)in.next(); if (next == null) { current = null; position = -1; return null; } if (current == null || !Navigator.isAncestorOrSelf(current, next)) { current = next; position++; return current; } } }
@Override protected boolean isIncludedInCopy(NodeInfo sourceNode) { switch (sourceNode.getNodeKind()) { case Type.ATTRIBUTE: case Type.NAMESPACE: return isIncludedInCopy(sourceNode.getParent()); default: return Navigator.isAncestorOrSelf(pivot, sourceNode) || Navigator.isAncestorOrSelf(sourceNode, pivot); } }
@Override protected boolean isIncludedInCopy(NodeInfo sourceNode) { switch (sourceNode.getNodeKind()) { case Type.ATTRIBUTE: case Type.NAMESPACE: return isIncludedInCopy(sourceNode.getParent()); default: return Navigator.isAncestorOrSelf(pivot, sourceNode) || Navigator.isAncestorOrSelf(sourceNode, pivot); } }
public NodeInfo next() throws XPathException { if (pending == null) { // we're done position = -1; return null; } else { while (true) { NodeInfo next = in.next(); if (next == null) { NodeInfo current = pending; position++; pending = null; return current; } if (Navigator.isAncestorOrSelf(pending, next)) { // discard the pending node pending = next; } else { // emit the pending node position++; NodeInfo current = pending; pending = next; return current; } } } }
public NodeInfo next() throws XPathException { if (pending == null) { // we're done position = -1; return null; } else { while (true) { NodeInfo next = in.next(); if (next == null) { NodeInfo current = pending; position++; pending = null; return current; } if (Navigator.isAncestorOrSelf(pending, next)) { // discard the pending node pending = next; } else { // emit the pending node position++; NodeInfo current = pending; pending = next; return current; } } } }
/** * Get the value of the item as a CharSequence. The string value for a node below the pivot is the same * as the string value for the corresponding node in the source tree; the string value for a node above the pivot * is the same as the string value of the pivot. For attributes and namespaces the string value is the same * as in the original tree. */ public CharSequence getStringValueCS() { if (Navigator.isAncestorOrSelf(original, pivot)) { return pivot.getStringValueCS(); } else { return original.getStringValueCS(); } }
/** * Get the value of the item as a CharSequence. The string value for a node below the pivot is the same * as the string value for the corresponding node in the source tree; the string value for a node above the pivot * is the same as the string value of the pivot. For attributes and namespaces the string value is the same * as in the original tree. */ public CharSequence getStringValueCS() { if (Navigator.isAncestorOrSelf(original, pivot)) { return pivot.getStringValueCS(); } else { return original.getStringValueCS(); } }
/** * Bind a variable used in this element to the compiled form of the XSLVariable element in which it is * declared * * @param qName The name of the variable * @return the XSLVariableDeclaration (that is, an xsl:variable or xsl:param instruction) for the variable, * or null if no declaration of the variable can be found */ public SourceBinding bindVariable(StructuredQName qName) { SourceBinding decl = bindLocalVariable(qName); if (decl != null) { return decl; } // Now check for a global variable // we rely on the search following the order of decreasing import precedence. SourceBinding binding = getPrincipalStylesheetModule().getGlobalVariableBinding(qName); if (binding == null || Navigator.isAncestorOrSelf(binding.getSourceElement(), this)) { // test case variable-0118 return null; } else { return binding; } }
/** * Bind a variable used in this element to the compiled form of the XSLVariable element in which it is * declared * * @param qName The name of the variable * @return the XSLVariableDeclaration (that is, an xsl:variable or xsl:param instruction) for the variable, * or null if no declaration of the variable can be found */ public SourceBinding bindVariable(StructuredQName qName) { SourceBinding decl = bindLocalVariable(qName); if (decl != null) { return decl; } // Now check for a global variable // we rely on the search following the order of decreasing import precedence. SourceBinding binding = getPrincipalStylesheetModule().getGlobalVariableBinding(qName); if (binding == null || Navigator.isAncestorOrSelf(binding.getSourceElement(), this)) { // test case variable-0118 return null; } else { return binding; } }
/** * Get the typed value of this node * @return the typed value. */ public AtomicSequence atomize() throws XPathException { switch (getNodeKind()) { case Type.ATTRIBUTE: case Type.TEXT: case Type.COMMENT: case Type.PROCESSING_INSTRUCTION: case Type.NAMESPACE: return original.atomize(); default: if (Navigator.isAncestorOrSelf(pivot, original)) { return original.atomize(); } else { // Ancestors of the pivot node have type xs:anyType. The typed value is therefore the // string value as an instance of xs:untypedAtomic return new UntypedAtomicValue(pivot.getStringValueCS()); } } }
/** * Get the typed value of this node * @return the typed value. */ public AtomicSequence atomize() throws XPathException { switch (getNodeKind()) { case Type.ATTRIBUTE: case Type.TEXT: case Type.COMMENT: case Type.PROCESSING_INSTRUCTION: case Type.NAMESPACE: return original.atomize(); default: if (Navigator.isAncestorOrSelf(pivot, original)) { return original.atomize(); } else { // Ancestors of the pivot node have type xs:anyType. The typed value is therefore the // string value as an instance of xs:untypedAtomic return new UntypedAtomicValue(pivot.getStringValueCS()); } } }
return ((TinyNodeImpl) a).isAncestorOrSelf((TinyNodeImpl) d); } else if (d instanceof TinyTextualElement.TinyTextualElementText) { return a.equals(d) || isAncestorOrSelf(a, d.getParent()); } else if (d.getNodeKind() == Type.NAMESPACE) {
return ((TinyNodeImpl) a).isAncestorOrSelf((TinyNodeImpl) d); } else if (d instanceof TinyTextualElement.TinyTextualElementText) { return a.equals(d) || isAncestorOrSelf(a, d.getParent()); } else if (d.getNodeKind() == Type.NAMESPACE) {
return super.iterateAxis(axisNumber, nodeTest); default: if (!original.isSameNodeInfo(pivot) && Navigator.isAncestorOrSelf(original, pivot)) {
return super.iterateAxis(axisNumber, nodeTest); default: if (!original.isSameNodeInfo(pivot) && Navigator.isAncestorOrSelf(original, pivot)) {