Lines Matching refs:node

59  * tree. You can wrap a DOM2DTM around a specific node and its subtree
77 /** The current position in the DOM tree. Last node examined for
92 synthesis of the implied xml: namespace declaration node. */
100 /** The node objects. The instance part of the handle indexes
101 * directly into this vector. Each DTM node may actually be
104 * single DTM Text node); this table points only to the first in
109 * Construct a DOM2DTM object from a DOM node.
135 // Document node. If it's an Element node, we need to immediately
139 // (If it's an EntityReference node, we're probably scrod. For now
172 * Construct the node map from the node.
174 * @param node The node that is to be added to the DTM.
177 * @param forceNodeType If not DTM.NULL, overrides the DOM node type.
181 * @return The index identity of the node that was added.
183 protected int addNode(Node node, int parentIndex,
216 type = node.getNodeType();
225 // rather than the node name.
239 String name = node.getNodeName();
247 m_nodes.addElement(node);
263 String nsURI = node.getNamespaceURI();
269 node.getNodeName() :
270 node.getLocalName();
275 localName = node.getNodeName(); // -sb
287 if(node.getLocalName()==null &&
290 // warning("DOM 'level 1' node "+node.getNodeName()+" won't be mapped properly in DOM2DTM.");
321 * This method iterates to the next node that will be added to the table.
322 * Each call to this method adds a new node to the table, unless the end
325 * @return The true if a next node is found or false if
381 // Last node posted at this level had no more children
467 // when true will keep the DTM node from being created.
469 // DTM only directly records the first DOM node of any logically-contiguous
470 // sequence. The lastTextNode value will be set to the last node in the
473 // the above loop for "Was the logically-preceeding sibling a text node".
475 // Finally, a DTM node should be considered a CDATASection only if all the
487 // If filtering, initially assume we're going to suppress the node
496 // Any Text node means DTM considers it all Text
521 // Inserting next. NOTE that we force the node type; for
587 // %TBD% If nexttype was forced to TEXT, patch the DTM node
599 * Return an DOM node for the given node.
601 * @param nodeHandle The node ID.
603 * @return A node representation of the DTM node.
626 * Get the next node identity value in the list, and call the iterator
629 * @param identity The node identity (index).
656 * %REVIEW% This relies on being able to test node-identity via
661 * @param node A node, which may be null.
663 * @return The node handle or <code>DTM.NULL</code>.
665 private int getHandleFromNode(Node node)
667 if (null != node)
676 if (m_nodes.elementAt(i) == node)
696 * %REVIEW% This relies on being able to test node-identity via
701 * @param node A node, which may be null.
703 * @return The node handle or <code>DTM.NULL</code>. */
704 public int getHandleOfNode(Node node)
706 if (null != node)
709 // This would be easier if m_root was always the Document node, but
711 if((m_root==node) ||
713 m_root==node.getOwnerDocument()) ||
715 m_root.getOwnerDocument()==node.getOwnerDocument())
718 // If node _is_ in m_root's tree, find its handle
723 for(Node cursor=node;
731 // We know this node; find its handle.
732 return getHandleFromNode(node);
733 } // for ancestors of node
734 } // if node and m_root in same Document
735 } // if node!=null
741 * Retrieves an attribute node by by qualified name and namespace URI.
743 * @param nodeHandle int Handle of the node upon which to look up this attribute..
748 * @return The attribute node handle with the specified name (
778 // of both -- retrieve the node, then test if the type matches
782 Node node = lookupNode(identity);
783 String nodeuri = node.getNamespaceURI();
788 String nodelocalname = node.getLocalName();
805 * Get the string-value of a node as a String object
807 * for the definition of a node's string-value).
809 * @param nodeHandle The node ID.
811 * @return A string object that represents the string-value of the given node.
817 Node node = getNode(nodeHandle);
818 // %TBD% If an element only has one text node, we should just use it
828 getNodeData(node, buf);
841 // If this is a DTM text node, it may be made of multiple DOM text
843 // records the first node in the sequence and requires that we
844 // pick up the others when we retrieve the DTM node's value.
849 while(node!=null)
851 buf.append(node.getNodeValue());
852 node=logicalNextDOMTextNode(node);
859 return m_xstrf.newstr( node.getNodeValue() );
863 * Determine if the string-value of a node is whitespace
865 * @param nodeHandle The node Handle.
867 * @return Return true if the given node is whitespace.
872 Node node = getNode(nodeHandle);
875 // If this is a DTM text node, it may be made of multiple DOM text
877 // records the first node in the sequence and requires that we
878 // pick up the others when we retrieve the DTM node's value.
883 while(node!=null)
885 buf.append(node.getNodeValue());
886 node=logicalNextDOMTextNode(node);
912 * @param node Node whose subtree is to be walked, gathering the
917 protected static void getNodeData(Node node, FastStringBuffer buf)
920 switch (node.getNodeType())
926 for (Node child = node.getFirstChild(); null != child;
935 case Node.ATTRIBUTE_NODE : // Never a child but might be our starting node
936 buf.append(node.getNodeValue());
948 * Given a node handle, return its DOM-style node name. This will
951 * @param nodeHandle the id of the node.
952 * @return String Name of this node, which may be an empty string.
959 Node node = getNode(nodeHandle);
962 return node.getNodeName();
966 * Given a node handle, return the XPath node name. This should be
970 * @param nodeHandle the id of the node.
971 * @return String Name of this node, which may be an empty string.
983 Node node = getNode(nodeHandle);
986 name = node.getNodeName();
1002 Node node = getNode(nodeHandle);
1005 name = node.getNodeName();
1016 * Given a node handle, return its XPath-style localname.
1020 * @param nodeHandle the id of the node.
1021 * @return String Local name of this node.
1061 Node node = getNode(nodeHandle);
1064 name = node.getLocalName();
1068 String qname = node.getNodeName();
1085 * Given a node handle, return the prefix used to map to the namespace.
1090 * @param nodeHandle the id of the node.
1091 * @return String prefix of this node's name, or "" if no explicit
1104 Node node = getNode(nodeHandle);
1107 String qname = node.getNodeName();
1116 Node node = getNode(nodeHandle);
1119 String qname = node.getNodeName();
1133 * Given a node handle, return its DOM-style namespace URI
1134 * (As defined in Namespaces, this is the declared URI which this node's
1139 * @param nodeHandle the id of the node.
1140 * @return String URI value of this node's namespace, or null if no
1149 Node node=(Node)m_nodes.elementAt(id);
1150 return node.getNamespaceURI();
1165 Node node = getNode(nodeHandle);
1168 nsuri = node.getNamespaceURI();
1182 /** Utility function: Given a DOM Text node, determine whether it is
1183 * logically followed by another Text or CDATASection node. This may
1224 * Given a node handle, return its node value. This is mostly
1228 * @param nodeHandle The node id.
1229 * @return String Value of this node, or null if not
1230 * meaningful for this node type.
1243 // If this is a DTM text node, it may be made of multiple DOM text
1245 // records the first node in the sequence and requires that we
1246 // pick up the others when we retrieve the DTM node's value.
1250 Node node = getNode(nodeHandle);
1251 Node n=logicalNextDOMTextNode(node);
1253 return node.getNodeValue();
1256 buf.append(node.getNodeValue());
1364 Node node = getNode(identity);
1365 if(node == elem)
1383 * node (see [3.3 Unparsed Entities]). It returns the empty string if
1598 * string-value of the given node (see http://www.w3.org/TR/xpath#data-model
1599 * for the definition of a node's string-value). Multiple calls to the
1603 * @param nodeHandle The node ID.
1622 Node node = getNode(nodeHandle);
1623 dispatchNodeData(node, ch, 0);
1624 // Text coalition -- a DTM text node may represent multiple
1628 while( null != (node=logicalNextDOMTextNode(node)) )
1630 dispatchNodeData(node, ch, 0);
1653 * @param node Node whose subtree is to be walked, gathering the
1656 protected static void dispatchNodeData(Node node,
1662 switch (node.getNodeType())
1668 for (Node child = node.getFirstChild(); null != child;
1684 String str = node.getNodeValue();
1687 ((CharacterNodeHandler)ch).characters(node);
1708 * @param nodeHandle The node ID.
1727 Node node = getNode(nodeHandle);
1728 treeWalker.traverseFragment(node);
1738 public void characters(Node node)
1757 * @param node an <code>int</code> value
1760 public SourceLocator getSourceLocatorFor(int node)