/** * Retrieve the factory object required to create DOM nodes * in the result tree. * * @return The result tree's DOM Document Node. */ public Document getDOMFactory() { if (null == this.m_DOMFactory) { this.m_DOMFactory = createDocument(); } return this.m_DOMFactory; }
/** * Returns the element name with the namespace prefix (if any) replaced * by the Namespace URI it was bound to. This is not a standard * representation of a node name, but it allows convenient * single-string comparison of the "universal" names of two nodes. * * @param elem Element to be examined. * * @return String in the form "namespaceURI:localname" if the node * belongs to a namespace, or simply "localname" if it doesn't. * @see #getExpandedAttributeName */ public String getExpandedElementName(Element elem) { String namespace = getNamespaceOfNode(elem); return (null != namespace) ? namespace + ":" + getLocalNameOfNode(elem) : getLocalNameOfNode(elem); }
child = child.getNextSibling()) getNodeData(child, buf);
if (node1 == node2 || isNodeTheSame(node1, node2)) return true; Node parent1 = getParentOfNode(node1); Node parent2 = getParentOfNode(node2); if (parent1 == parent2 || isNodeTheSame(parent1, parent2)) // then we know they are siblings isNodeAfter = isNodeAfterSibling(parent1, node1, node2); else parent1 = getParentOfNode(parent1); parent2 = getParentOfNode(parent2); startNode2 = getParentOfNode(startNode2); startNode1 = getParentOfNode(startNode1); if (startNode1 == startNode2 || isNodeTheSame(startNode1, startNode2)) // common parent? isNodeAfter = isNodeAfterSibling(startNode1, prevChild1, prevChild2); startNode1 = getParentOfNode(startNode1); prevChild2 = startNode2; startNode2 = getParentOfNode(startNode2);
if (DOMHelper.isNodeAfter(testNode, endNode) && !DOMHelper.isNodeTheSame(testNode, endNode)) leadNodes.addElement(testNode);
parent = locateAttrParent((Element) node, attr);
/** * Get the depth level of this node in the tree (equals 1 for * a parentless node). * * @param n Node to be examined. * @return the number of ancestors, plus one * @xsl.usage internal */ public short getLevel(Node n) { short level = 1; while (null != (n = getParentOfNode(n))) { level++; } return level; }
/** * Look up an attribute's local name by index. * * @param index The attribute index (zero-based). * @return The local name, or the empty string if Namespace * processing is not being performed, or null * if the index is out of range. */ public String getLocalName(int index) { return m_dh.getLocalNameOfNode(((Attr) m_attrs.item(index))); }
/** * Look up an attribute's Namespace URI by index. * * @param index The attribute index (zero-based). * @return The Namespace URI, or the empty string if none * is available, or null if the index is out of * range. */ public String getURI(int index) { String ns = m_dh.getNamespaceOfNode(((Attr) m_attrs.item(index))); if(null == ns) ns = ""; return ns; }
return DOMHelper.isNodeAfter(node1, node2);
if (child1 == child || isNodeTheSame(child1, child)) else if (child2 == child || isNodeTheSame(child2, child)) if (child1 == child || isNodeTheSame(child1, child)) else if (child2 == child || isNodeTheSame(child2, child))
if (node1 == node2 || isNodeTheSame(node1, node2)) return true; Node parent1 = getParentOfNode(node1); Node parent2 = getParentOfNode(node2); if (parent1 == parent2 || isNodeTheSame(parent1, parent2)) // then we know they are siblings isNodeAfter = isNodeAfterSibling(parent1, node1, node2); else parent1 = getParentOfNode(parent1); parent2 = getParentOfNode(parent2); startNode2 = getParentOfNode(startNode2); startNode1 = getParentOfNode(startNode1); if (startNode1 == startNode2 || isNodeTheSame(startNode1, startNode2)) // common parent? isNodeAfter = isNodeAfterSibling(startNode1, prevChild1, prevChild2); startNode1 = getParentOfNode(startNode1); prevChild2 = startNode2; startNode2 = getParentOfNode(startNode2);
if (DOMHelper.isNodeAfter(startNode, testNode) && !DOMHelper.isNodeTheSame(startNode, testNode)) trailNodes.addElement(testNode);
parent = locateAttrParent((Element) node, attr);
/** * Get the first unparented node in the ancestor chain. * @deprecated * * @param node Starting node, to specify which chain to chase * * @return the topmost ancestor. */ public Node getRoot(Node node) { Node root = null; while (node != null) { root = node; node = getParentOfNode(node); } return root; }
/** * Look up an attribute's local name by index. * * @param index The attribute index (zero-based). * @return The local name, or the empty string if Namespace * processing is not being performed, or null * if the index is out of range. */ public String getLocalName(int index) { return m_dh.getLocalNameOfNode(((Attr) m_attrs.item(index))); }
/** * Look up an attribute's Namespace URI by index. * * @param index The attribute index (zero-based). * @return The Namespace URI, or the empty string if none * is available, or null if the index is out of * range. */ public String getURI(int index) { String ns = m_dh.getNamespaceOfNode(((Attr) m_attrs.item(index))); if(null == ns) ns = ""; return ns; }
return DOMHelper.isNodeAfter(node1, node2);
if (child1 == child || isNodeTheSame(child1, child)) else if (child2 == child || isNodeTheSame(child2, child)) if (child1 == child || isNodeTheSame(child1, child)) else if (child2 == child || isNodeTheSame(child2, child))
if (node1 == node2 || isNodeTheSame(node1, node2)) return true; Node parent1 = getParentOfNode(node1); Node parent2 = getParentOfNode(node2); if (parent1 == parent2 || isNodeTheSame(parent1, parent2)) // then we know they are siblings isNodeAfter = isNodeAfterSibling(parent1, node1, node2); else parent1 = getParentOfNode(parent1); parent2 = getParentOfNode(parent2); startNode2 = getParentOfNode(startNode2); startNode1 = getParentOfNode(startNode1); if (startNode1 == startNode2 || isNodeTheSame(startNode1, startNode2)) // common parent? isNodeAfter = isNodeAfterSibling(startNode1, prevChild1, prevChild2); startNode1 = getParentOfNode(startNode1); prevChild2 = startNode2; startNode2 = getParentOfNode(startNode2);