/** * Determine whether this is the same node as another node. * Note: a.equals(b) if and only if generateId(a)==generateId(b). * This method has the same semantics as isSameNode() in DOM Level 3, but * works on Saxon NodeInfo objects rather than DOM Node objects. * * @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. */ public boolean equals(Object other) { return other instanceof NamespaceNode && element.equals(((NamespaceNode) other).element) && nsBinding.equals(((NamespaceNode) other).nsBinding); }
/** * Determine whether this is the same node as another node. * Note: a.equals(b) if and only if generateId(a)==generateId(b). * This method has the same semantics as isSameNode() in DOM Level 3, but * works on Saxon NodeInfo objects rather than DOM Node objects. * * @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. */ public boolean equals(Object other) { return other instanceof NamespaceNode && element.equals(((NamespaceNode) other).element) && nsBinding.equals(((NamespaceNode) other).nsBinding); }
private void addNamespaceInternal(/*@NotNull*/ NamespaceBinding nscode, boolean externalCall) { if (namespaceList == null) { namespaceList = new NamespaceBinding[]{nscode}; } else { NamespaceBinding[] nsList = namespaceList; for (int i = 0; i < nsList.length; i++) { if (nsList[i].equals(nscode)) { return; } if (nsList[i].getPrefix().equals(nscode.getPrefix())) { if (nsList[i].getURI().isEmpty()) { // this is an undeclaration; replace it with the new declaration nsList[i] = nscode; return; } else if (externalCall) { throw new IllegalArgumentException("New namespace conflicts with existing namespace binding"); } else { return; } } } int len = nsList.length; NamespaceBinding[] ns2 = new NamespaceBinding[len + 1]; System.arraycopy(nsList, 0, ns2, 0, len); ns2[len] = nscode; namespaceList = ns2; } }
private void addNamespaceInternal(/*@NotNull*/ NamespaceBinding nscode, boolean externalCall) { if (namespaceList == null) { namespaceList = new NamespaceBinding[]{nscode}; } else { NamespaceBinding[] nsList = namespaceList; for (int i = 0; i < nsList.length; i++) { if (nsList[i].equals(nscode)) { return; } if (nsList[i].getPrefix().equals(nscode.getPrefix())) { if (nsList[i].getURI().isEmpty()) { // this is an undeclaration; replace it with the new declaration nsList[i] = nscode; return; } else if (externalCall) { throw new IllegalArgumentException("New namespace conflicts with existing namespace binding"); } else { return; } } } int len = nsList.length; NamespaceBinding[] ns2 = new NamespaceBinding[len + 1]; System.arraycopy(nsList, 0, ns2, 0, len); ns2[len] = nscode; namespaceList = ns2; } }
public void namespace(NamespaceBindingSet namespaceBindings, int properties) throws XPathException { for (NamespaceBinding ns : namespaceBindings) { if (!acceptAttributes) { throw NoOpenStartTagException.makeNoOpenStartTagException( Type.NAMESPACE, ns.getPrefix(), getPipelineConfiguration().getHostLanguage(), inDocument, ExplicitLocation.UNKNOWN_LOCATION); } // avoid duplicates for (int n = 0; n < countStack[depth - 1]; n++) { if (namespaces[namespacesSize - 1 - n].equals(namespaceBindings)) { return; } } addToStack(ns); countStack[depth - 1]++; } }
if (namespaces[i].equals(nsBinding)) {
if (namespaces[i].equals(nsBinding)) {
public void namespace(NamespaceBindingSet namespaceBindings, int properties) throws XPathException { for (NamespaceBinding ns : namespaceBindings) { if (!acceptAttributes) { throw NoOpenStartTagException.makeNoOpenStartTagException( Type.NAMESPACE, ns.getPrefix(), getPipelineConfiguration().getHostLanguage(), inDocument, ExplicitLocation.UNKNOWN_LOCATION); } // avoid duplicates for (int n = 0; n < countStack[depth - 1]; n++) { if (namespaces[namespacesSize - 1 - n].equals(namespaceBindings)) { return; } } addToStack(ns); countStack[depth - 1]++; } }