Lines Matching refs:node

69    * Iterator that returns all immediate children of a given node
80 * or set current node to END, to indicate request-not-honored?
82 * @param node Sets the root of the iteration.
86 public DTMAxisIterator setStartNode(int node)
89 if (node == DTMDefaultBase.ROOTNODE)
90 node = getDocument();
93 _startNode = node;
94 _currentNode = (node == DTM.NULL) ? DTM.NULL
95 : _firstch2(makeNodeIdentity(node));
104 * Get the next node in the iteration.
106 * @return The next node handle in the iteration, or END if no more
112 int node = _currentNode;
113 _currentNode = _nextsib2(node);
114 return returnNode(makeNodeHandle(node));
122 * Iterator that returns the parent of a given node. Note that
123 * this delivers only a single node; if you want all the ancestors,
136 * @param node Sets the root of the iteration.
140 public DTMAxisIterator setStartNode(int node)
143 if (node == DTMDefaultBase.ROOTNODE)
144 node = getDocument();
147 _startNode = node;
149 if (node != DTM.NULL)
150 _currentNode = _parent2(makeNodeIdentity(node));
161 * Set the node type of the parent that we're looking for.
179 * Get the next node in the iteration. In this case, we return
182 * @return The next node handle in the iteration, or END.
213 * Iterator that returns children of a given type for a given node.
239 * @param node Sets the root of the iteration.
243 public DTMAxisIterator setStartNode(int node)
246 if (node == DTMDefaultBase.ROOTNODE)
247 node = getDocument();
250 _startNode = node;
251 _currentNode = (node == DTM.NULL)
262 * Get the next node in the iteration.
264 * @return The next node handle in the iteration, or END.
268 int node = _currentNode;
269 if (node == DTM.NULL)
275 while (node != DTM.NULL && _exptype2(node) != nodeType) {
276 node = _nextsib2(node);
280 // need to compare the expType with DTM.NTYPES. A child node of
282 // processing instruction node. Only element node has an extended
286 while (node != DTM.NULL) {
287 eType = _exptype2(node);
291 node = _nextsib2(node);
295 if (node == DTM.NULL) {
299 _currentNode = _nextsib2(node);
300 return returnNode(makeNodeHandle(node));
306 * Return the node at the given position.
313 int node = _currentNode;
318 while (node != DTM.NULL) {
319 if (_exptype2(node) == nodeType) {
322 return makeNodeHandle(node);
325 node = _nextsib2(node);
330 while (node != DTM.NULL) {
331 if (_exptype2(node) >= DTM.NTYPES) {
334 return makeNodeHandle(node);
336 node = _nextsib2(node);
346 * for a given node, filtered by extended type ID.
366 * Get the next node in the iteration.
368 * @return The next node handle in the iteration, or END.
375 final int node = _startNode;
376 int expType = _exptype2(makeNodeIdentity(node));
378 _currentNode = node;
382 return returnNode(node);
388 return returnNode(node);
393 return returnNode(node);
403 * Iterator that returns all siblings of a given node.
412 * @param node Sets the root of the iteration.
416 public DTMAxisIterator setStartNode(int node)
419 if (node == DTMDefaultBase.ROOTNODE)
420 node = getDocument();
423 _startNode = node;
424 _currentNode = makeNodeIdentity(node);
433 * Get the next node in the iteration.
435 * @return The next node handle in the iteration, or END.
446 * Iterator that returns all following siblings of a given node.
467 * Get the next node in the iteration.
469 * @return The next node handle in the iteration, or END.
477 int node = _currentNode;
481 while ((node = _nextsib2(node)) != DTM.NULL && _exptype2(node) != nodeType) {}
484 while ((node = _nextsib2(node)) != DTM.NULL && _exptype2(node) < DTM.NTYPES) {}
487 _currentNode = node;
489 return (node == DTM.NULL)
491 : returnNode(makeNodeHandle(node));
508 * @param node Sets the root of the iteration.
512 public DTMAxisIterator setStartNode(int node)
515 if (node == DTMDefaultBase.ROOTNODE)
516 node = getDocument();
519 _startNode = node;
520 _currentNode = getFirstAttributeIdentity(makeNodeIdentity(node));
529 * Get the next node in the iteration.
531 * @return The next node handle in the iteration, or END.
536 final int node = _currentNode;
538 if (node != NULL) {
539 _currentNode = getNextAttributeIdentity(node);
540 return returnNode(makeNodeHandle(node));
573 * @param node Sets the root of the iteration.
577 public DTMAxisIterator setStartNode(int node)
581 _startNode = node;
583 _currentNode = getTypedAttribute(node, _nodeType);
592 * Get the next node in the iteration.
594 * @return The next node handle in the iteration, or END.
599 final int node = _currentNode;
605 return returnNode(node);
610 * Iterator that returns preceding siblings of a given node
616 * The node identity of _startNode for this iterator
634 * @param node Sets the root of the iteration.
638 public DTMAxisIterator setStartNode(int node)
641 if (node == DTMDefaultBase.ROOTNODE)
642 node = getDocument();
645 _startNode = node;
646 node = _startNodeID = makeNodeIdentity(node);
648 if(node == NULL)
650 _currentNode = node;
654 int type = _type2(node);
658 _currentNode = node;
662 // Be careful to handle the Document node properly
663 _currentNode = _parent2(node);
667 _currentNode = node;
677 * Get the next node in the iteration.
679 * @return The next node handle in the iteration, or END.
690 final int node = _currentNode;
691 _currentNode = _nextsib2(node);
693 return returnNode(makeNodeHandle(node));
700 * a given node
721 * Get the next node in the iteration.
723 * @return The next node handle in the iteration, or END.
727 int node = _currentNode;
733 while (node != NULL && node != startNodeID && _exptype2(node) != nodeType) {
734 node = _nextsib2(node);
738 while (node != NULL && node != startNodeID && _exptype2(node) < DTM.NTYPES) {
739 node = _nextsib2(node);
743 if (node == DTM.NULL || node == startNodeID) {
748 _currentNode = _nextsib2(node);
749 return returnNode(makeNodeHandle(node));
754 * Return the index of the last node in this iterator.
763 int node = _currentNode;
769 while (node != NULL && node != startNodeID) {
770 if (_exptype2(node) == nodeType) {
773 node = _nextsib2(node);
777 while (node != NULL && node != startNodeID) {
778 if (_exptype2(node) >= DTM.NTYPES) {
781 node = _nextsib2(node);
792 * Iterator that returns preceding nodes of a given node.
793 * This includes the node set {root+1, start-1}, but excludes
803 * The stack of start node + ancestors up to the root of the tree,
855 * @param node Sets the root of the iteration.
859 public DTMAxisIterator setStartNode(int node)
862 if (node == DTMDefaultBase.ROOTNODE)
863 node = getDocument();
866 node = makeNodeIdentity(node);
871 if (_type2(node) == DTM.ATTRIBUTE_NODE)
872 node = _parent2(node);
874 _startNode = node;
875 _stack[index = 0] = node;
877 parent=node;
890 --index; // Pop actual root node (if not start) back off the stack
892 _currentNode=_stack[index]; // Last parent before root node
903 * Get the next node in the iteration.
905 * @return The next node handle in the iteration, or END.
929 * Resets the iterator to the last start node.
956 * given node. This includes the node set {root+1, start-1}, but
977 * Get the next node in the iteration.
979 * @return The next node handle in the iteration, or END.
983 int node = _currentNode;
988 node++;
991 node = NULL;
994 else if (node >= _stack[_sp]) {
996 node = NULL;
1000 else if (_exptype2(node) == nodeType) {
1009 node++;
1012 node = NULL;
1015 else if (node >= _stack[_sp]) {
1017 node = NULL;
1022 expType = _exptype2(node);
1037 _currentNode = node;
1039 return (node == NULL) ? NULL : returnNode(makeNodeHandle(node));
1044 * Iterator that returns following nodes of for a given node.
1059 * @param node Sets the root of the iteration.
1063 public DTMAxisIterator setStartNode(int node)
1066 if (node == DTMDefaultBase.ROOTNODE)
1067 node = getDocument();
1070 _startNode = node;
1072 //_currentNode = m_traverser.first(node);
1074 node = makeNodeIdentity(node);
1077 int type = _type2(node);
1081 node = _parent2(node);
1082 first = _firstch2(node);
1092 first = _nextsib2(node);
1095 node = _parent2(node);
1097 while (NULL == first && NULL != node);
1101 // _currentNode precedes possible following(node) nodes
1109 * Get the next node in the iteration.
1111 * @return The next node handle in the iteration, or END.
1116 int node = _currentNode;
1119 int current = makeNodeIdentity(node);
1128 return returnNode(node);
1135 return returnNode(node);
1142 * Iterator that returns following nodes of a given type for a given node.
1162 * Get the next node in the iteration.
1164 * @return The next node handle in the iteration, or END.
1169 int node;
1177 node = currentNodeID;
1178 current = node;
1188 while (node != DTM.NULL && _exptype2(node) != nodeType);
1192 node = currentNodeID;
1193 current = node;
1203 while (node != DTM.NULL
1204 && (_exptype2(node) != nodeType && _type2(node) != nodeType));
1208 return (node == DTM.NULL ? DTM.NULL :returnNode(makeNodeHandle(node)));
1213 * Iterator that returns the ancestors of a given node in document
1231 /** The real start node for this axes, since _startNode will be adjusted. */
1238 * @return The root node of the iteration.
1283 * @param node Sets the root of the iteration.
1287 public DTMAxisIterator setStartNode(int node)
1290 if (node == DTMDefaultBase.ROOTNODE)
1291 node = getDocument();
1292 m_realStartNode = node;
1296 int nodeID = makeNodeIdentity(node);
1305 // Start from the current node's parent if
1309 node = makeNodeHandle(nodeID);
1312 _startNode = node;
1315 //m_ancestors.addElement(node);
1323 m_ancestors[m_size++] = node;
1325 node = makeNodeHandle(nodeID);
1341 * Resets the iterator to the last start node.
1358 * Get the next node in the iteration.
1360 * @return The next node handle in the iteration, or END.
1387 * Typed iterator that returns the ancestors of a given node.
1410 * @param node Sets the root of the iteration.
1414 public DTMAxisIterator setStartNode(int node)
1417 if (node == DTMDefaultBase.ROOTNODE)
1418 node = getDocument();
1419 m_realStartNode = node;
1423 int nodeID = makeNodeIdentity(node);
1436 node = makeNodeHandle(nodeID);
1439 _startNode = node;
1488 * Return the node at the given position.
1500 * Returns the position of the last node within the iteration, as
1509 * Iterator that returns the descendants of a given node.
1518 * @param node Sets the root of the iteration.
1522 public DTMAxisIterator setStartNode(int node)
1525 if (node == DTMDefaultBase.ROOTNODE)
1526 node = getDocument();
1529 node = makeNodeIdentity(node);
1530 _startNode = node;
1533 node--;
1535 _currentNode = node;
1544 * Tell if this node identity is a descendant. Assumes that
1545 * the node info for the element has already been obtained.
1549 * the parent is the _startNode's next sibling, or indeed any node
1554 * @param identity The index number of the node in question.
1563 * Get the next node in the iteration.
1565 * @return The next node handle in the iteration, or END.
1577 int node = _currentNode;
1580 // %OPT% If the startNode is the root node, do not need
1585 node++;
1586 eType = _exptype2(node);
1598 node++;
1599 type = _type2(node);
1601 if (NULL == type ||!isDescendant(node)) {
1609 _currentNode = node;
1610 return returnNode(makeNodeHandle(node)); // make handle.
1634 * Typed iterator that returns the descendants of a given node.
1654 * Get the next node in the iteration.
1656 * @return The next node handle in the iteration, or END.
1665 int node = _currentNode;
1674 node++;
1675 expType = _exptype2(node);
1677 if (NULL == expType || _parent2(node) < startNode && startNode != node) {
1684 // %OPT% If the start node is root (e.g. in the case of //node),
1691 node++;
1692 expType = _exptype2(node);
1705 node++;
1706 expType = _exptype2(node);
1708 if (NULL == expType || _parent2(node) < startNode && startNode != node) {
1717 _currentNode = node;
1718 return returnNode(makeNodeHandle(node));
1723 * Iterator that returns a given node only if it is of a given type.
1743 * Get the next node in the iteration.
1745 * @return The next node handle in the iteration, or END.
1807 // The maximum value of the current node index.
1815 /** %OPT% If the offset and length of a Text node are within certain limits,
1821 // The number of bits for the length of a Text node.
1824 // The number of bits for the offset of a Text node.
1919 * @param identity A node identity, which <em>must not</em> be equal to
1935 * @param identity A node identity, which <em>must not</em> be equal to
1951 * @param identity A node identity, which <em>must not</em> be equal to
1967 * @param identity A node identity, which <em>must not</em> be equal to
1983 * @param identity A node identity, which <em>must not</em> be equal to
2029 * Return the node type from the expanded type
2066 * each element (such as allocating a new tree node or writing
2211 * each element (such as finalising a tree node or writing
2306 // Add a NULL entry to the end of the node arrays as
2322 * Construct the node map from the node.
2329 * @param canHaveFirstChild true if the node can have a first child, false
2332 * @return The index identity of the node that was added.
2389 * append the appropriate flavor of text/cdata node.
2408 // contained no characters. They should not result in a node.
2476 * Given a node handle, get the index of the node's first attribute.
2478 * @param nodeHandle int Handle of the node.
2516 * Given a node identity, get the index of the node's first attribute.
2518 * @param identity int identity of the node.
2554 * Given a node identity for an attribute, advance to the next attribute.
2556 * @param identity int identity of the attribute node. This
2557 * <strong>must</strong> be an attribute node.
2559 * @return int DTM node-identity of the resolved attr,
2582 * Given a node handle and an expanded type ID, get the index of the node's
2585 * @param nodeHandle int Handle of the node.
2631 * Given a node handle, return its XPath- style localname. (As defined in
2634 * @param nodeHandle the id of the node.
2635 * @return String Local name of this node.
2654 * Given a node handle, return the XPath node name. This should be the name
2657 * @param nodeHandle the id of the node.
2658 * @return String Name of this node, which may be an empty string.
2699 * Given a node handle, return its DOM-style node name. This will include
2702 * @param nodeHandle the id of the node.
2703 * @return String Name of this node, which may be an empty string.
2765 * Get the string-value of a node as a String object
2767 * for the definition of a node's string-value).
2769 * @param nodeHandle The node ID.
2771 * @return A string object that represents the string-value of the given node.
2879 * Get the string- value of a node as a String object (see http: //www. w3.
2880 * org/TR/xpath#data- model for the definition of a node's string- value).
2882 * @param nodeHandle The node ID.
2884 * @return A string object that represents the string-value of the given node.
2999 * string-value of the given node (see http://www.w3.org/TR/xpath#data-model
3000 * for the definition of a node's string-value). Multiple calls to the
3004 * @param nodeHandle The node ID.
3118 * Given a node handle, return its node value. This is mostly
3122 * @param nodeHandle The node id.
3123 * @return String Value of this node, or null if not
3124 * meaningful for this node type.
3166 * Copy the String value of a Text node to a SerializationHandler
3185 * Copy an Element node to a SerializationHandler.
3187 * @param nodeID The node identity
3188 * @param exptype The expanded type of the Element node
3190 * @return The qualified name of the Element node.
3237 * @param nodeID The Element node identity
3247 // namespace node (xmlns:xml="http://www.w3.org/XML/1998/namespace")
3248 // declared on the root element node. In this case, there is no
3261 // Find the first namespace node
3274 // Retrieve the name of the namespace node
3278 // Retrieve the node value of the namespace node
3304 * Return the next namespace node following the given base node.
3306 * @baseID The node identity of the base node, which can be an
3307 * element, attribute or namespace node.
3308 * @return The namespace node immediately following the base node.
3323 * @param nodeID The Element node identity
3338 * Copy an Attribute node to a SerializationHandler
3340 * @param nodeID The node identity
3341 * @param exptype The expanded type of the Element node
3349 final String uri = getNamespaceName(node);
3351 final String prefix = getPrefix(node);
3354 handler.addAttribute(getNodeName(node), getNodeValue(node));