Home | History | Annotate | Download | only in libxml2

Lines Matching defs:node

92 * in a way, that it stop evaluation at the first node.
124 * arbitrary limit the maximum length of those node set. 10000000 is
146 * @x: a node
147 * @y: another node
152 * it's the same node, +1 otherwise
262 * TODO: when compatibility allows remove all "fake node libxslt" strings
438 ctxt->context->lastError.node = ctxt->context->debugNode;
964 fprintf(output, "Node is NULL !\n");
989 fprintf(output, "Node is NULL !\n");
1103 fprintf(output, "Object is a Node Set :\n");
1139 fprintf(output, "Object is a point : index %d in node", cur->index);
1150 fprintf(output, "node\n");
1159 fprintf(output, "node\n");
1166 fprintf(output, "node\n");
1244 fprintf(output, "NODE"); break;
1301 fprintf(output, "'node' "); break;
1816 printf("# node-sets\n");
1903 * look out for namespace nodes in the node-set.
1952 * There are 5 slots for: node-set, string, number, boolean, and
2086 * it with the single Node @val
2674 * Pops a node-set from the stack, handling conversion if needed.
2677 * Returns the node-set
2923 * field, the value stored is actually - the node number (starting at -1)
2968 * @node1: the first node
2969 * @node2: the second node
2974 * it's the same node, -1 otherwise
3116 * @node1: the first node
3117 * @node2: the second node
3123 * it's the same node, -1 otherwise
3171 * Find nearest element node.
3184 * parent of such a node is not an element node?
3407 * @set: the node set
3409 * Sort the node set in document order
3423 * Use the old Shell's sort implementation to sort the node-set
3456 * @node: the parent node of the namespace XPath node
3457 * @ns: the libxml namespace declaration node.
3459 * Namespace node in libxml don't match the XPath semantic. In a node set
3461 * parent node in the XPath semantic.
3466 xmlXPathNodeSetDupNs(xmlNodePtr node, xmlNsPtr ns) {
3471 if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
3488 cur->next = (xmlNsPtr) node;
3494 * @ns: the XPath namespace node found in a nodeset.
3496 * Namespace nodes in libxml don't match the XPath semantic. In a node set
3498 * parent node in the XPath semantic. Check if such a node needs to be freed
3587 * @cur: the node-set
3588 * @val: the node
3624 * @cur: the initial node set
3625 * @node: the hosting node
3626 * @ns: a the namespace node
3628 * add a new namespace node to an existing NodeSet
3633 xmlXPathNodeSetAddNs(xmlNodeSetPtr cur, xmlNodePtr node, xmlNsPtr ns) {
3637 if ((cur == NULL) || (ns == NULL) || (node == NULL) ||
3639 (node->type != XML_ELEMENT_NODE))
3649 (((xmlNsPtr)cur->nodeTab[i])->next == (xmlNsPtr) node) &&
3683 cur->nodeTab[cur->nodeNr++] = xmlXPathNodeSetDupNs(node, ns);
3689 * @cur: the initial node set
3750 * @cur: the initial node set
3754 * when we are sure the node is not already in the set.
3832 * Optimization: Create an equally sized node-set
3982 * Free the namespace node.
4116 * @cur: the initial node set
4129 * find node in nodeTab
4137 "xmlXPathNodeSetDel: Node %s wasn't found in NodeList\n",
4153 * @cur: the initial node set
4195 * @set: the node set to clear
4208 xmlNodePtr node;
4211 node = set->nodeTab[i];
4212 if ((node != NULL) &&
4213 (node->type == XML_NAMESPACE_DECL))
4214 xmlXPathNodeSetFreeNs((xmlNsPtr) node);
4222 * @set: the node set to be cleared
4236 xmlNodePtr node;
4239 node = set->nodeTab[i];
4240 if ((node != NULL) &&
4241 (node->type == XML_NAMESPACE_DECL))
4242 xmlXPathNodeSetFreeNs((xmlNsPtr) node);
4322 * it with the single Node @val
4421 xmlXPathErrMemory(NULL, "creating node set object\n");
4451 * @nodes1: a node-set
4452 * @nodes2: a node-set
4455 * node-set set:difference (node-set, node-set)
4457 * Returns the difference between the two node sets, or nodes1 if
4487 * @nodes1: a node-set
4488 * @nodes2: a node-set
4491 * node-set set:intersection (node-set, node-set)
4493 * Returns a node set comprising the nodes that are within both the
4494 * node sets passed as arguments
4523 * @nodes: a node-set, sorted by document order
4526 * node-set set:distinct (node-set)
4564 * @nodes: a node-set
4567 * node-set set:distinct (node-set)
4569 * is called with the sorted node-set
4585 * @nodes1: a node-set
4586 * @nodes2: a node-set
4589 * boolean set:has-same-node(node-set, node-set)
4591 * Returns true (1) if @nodes1 shares any node with @nodes2, false (0)
4614 * @nodes: a node-set, sorted by document order
4615 * @node: a node
4618 * node-set set:leading (node-set, node-set)
4620 * Returns the nodes in @nodes that precede @node in document order,
4621 * @nodes if @node is NULL or an empty node-set if @nodes
4622 * doesn't contain @node
4625 xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes, xmlNodePtr node) {
4630 if (node == NULL)
4637 (!xmlXPathNodeSetContains(nodes, node)))
4643 if (cur == node)
4653 * @nodes: a node-set
4654 * @node: a node
4657 * node-set set:leading (node-set, node-set)
4661 * Returns the nodes in @nodes that precede @node in document order,
4662 * @nodes if @node is NULL or an empty node-set if @nodes
4663 * doesn't contain @node
4666 xmlXPathNodeLeading (xmlNodeSetPtr nodes, xmlNodePtr node) {
4668 return(xmlXPathNodeLeadingSorted(nodes, node));
4673 * @nodes1: a node-set, sorted by document order
4674 * @nodes2: a node-set, sorted by document order
4677 * node-set set:leading (node-set, node-set)
4679 * Returns the nodes in @nodes1 that precede the first node in @nodes2
4681 * an empty node-set if @nodes1 doesn't contain @nodes2
4693 * @nodes1: a node-set
4694 * @nodes2: a node-set
4697 * node-set set:leading (node-set, node-set)
4701 * Returns the nodes in @nodes1 that precede the first node in @nodes2
4703 * an empty node-set if @nodes1 doesn't contain @nodes2
4719 * @nodes: a node-set, sorted by document order
4720 * @node: a node
4723 * node-set set:trailing (node-set, node-set)
4725 * Returns the nodes in @nodes that follow @node in document order,
4726 * @nodes if @node is NULL or an empty node-set if @nodes
4727 * doesn't contain @node
4730 xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes, xmlNodePtr node) {
4735 if (node == NULL)
4742 (!xmlXPathNodeSetContains(nodes, node)))
4748 if (cur == node)
4759 * @nodes: a node-set
4760 * @node: a node
4763 * node-set set:trailing (node-set, node-set)
4767 * Returns the nodes in @nodes that follow @node in document order,
4768 * @nodes if @node is NULL or an empty node-set if @nodes
4769 * doesn't contain @node
4772 xmlXPathNodeTrailing (xmlNodeSetPtr nodes, xmlNodePtr node) {
4774 return(xmlXPathNodeTrailingSorted(nodes, node));
4779 * @nodes1: a node-set, sorted by document order
4780 * @nodes2: a node-set, sorted by document order
4783 * node-set set:trailing (node-set, node-set)
4785 * Returns the nodes in @nodes1 that follow the first node in @nodes2
4787 * an empty node-set if @nodes1 doesn't contain @nodes2
4799 * @nodes1: a node-set
4800 * @nodes2: a node-set
4803 * node-set set:trailing (node-set, node-set)
4807 * Returns the nodes in @nodes1 that follow the first node in @nodes2
4809 * an empty node-set if @nodes1 doesn't contain @nodes2
5615 xmlNodePtr node;
5618 node = tmpset->nodeTab[i];
5619 if ((node != NULL) &&
5620 (node->type == XML_NAMESPACE_DECL))
5622 xmlXPathNodeSetFreeNs((xmlNsPtr) node);
5713 * @node: a node
5715 * Converts a node to its string value.
5720 xmlXPathCastNodeToString (xmlNodePtr node) {
5722 if ((ret = xmlNodeGetContent(node)) == NULL)
5729 * @ns: a node-set
5731 * Converts a node-set to its string value.
5868 * @node: a node
5870 * Converts a node to its number value
5875 xmlXPathCastNodeToNumber (xmlNodePtr node) {
5879 if (node == NULL)
5881 strval = xmlXPathCastNodeToString(node);
5892 * @ns: a node-set
5894 * Converts a node-set to its number value
6010 * @ns: a node-set
6012 * Converts a node-set to its boolean value
6116 ret->node = NULL;
6310 * @node: a node pointer
6312 * Function computing the beginning of the string value of the node,
6318 xmlXPathNodeValHash(xmlNodePtr node) {
6324 if (node == NULL)
6327 if (node->type == XML_DOCUMENT_NODE) {
6328 tmp = xmlDocGetRootElement((xmlDocPtr) node);
6330 node = node->children;
6332 node = tmp;
6334 if (node == NULL)
6338 switch (node->type) {
6343 string = node->content;
6351 string = ((xmlNsPtr)node)->href;
6359 tmp = ((xmlAttrPtr) node)->children;
6362 tmp = node->children;
6394 * Skip to next node
6402 if (tmp == node)
6414 if (tmp == node) {
6431 * Function computing the beginning of the string value of the node,
6451 * @arg: the node set
6460 * If one object to be compared is a node-set and the other is a number,
6461 * then the comparison will be true if and only if there is a node in the
6462 * node-set such that the result of performing the comparison on the number
6464 * node to a number using the number function is true.
6507 * @arg: the node set
6516 * If one object to be compared is a node-set and the other is a string,
6517 * then the comparison will be true if and only if there is a node in
6518 * the node-set such that the result of performing the comparison on the
6519 * string-value of the node and the other string is true.
6560 * @arg1: the first node set object
6561 * @arg2: the second node set object
6565 * If both objects to be compared are node-sets, then the comparison
6566 * will be true if and only if there is a node in the first node-set
6567 * and a node in the second node-set such that the result of performing
6570 * When neither object to be compared is a node-set and the operator
6663 * @arg: the node set
6672 * If one object to be compared is a node-set and the other is a boolean,
6675 * the node-set to a boolean using the boolean function is true.
6712 * If one object to be compared is a node-set and the other is a string,
6713 * then the comparison will be true if and only if there is a node in
6714 * the node-set such that the result of performing the comparison on the
6715 * string-value of the node and the other string is true.
6733 * (since there is no node equal, and no node not equal)
6770 * If one object to be compared is a node-set and the other is a number,
6771 * then the comparison will be true if and only if there is a node in
6772 * the node-set such that the result of performing the comparison on the
6774 * of that node to a number using the number function is true.
6830 * If both objects to be compared are node-sets, then the comparison
6831 * will be true if and only if there is a node in the first node-set and
6832 * a node in the second node-set such that the result of performing the
6866 * for equal, check if there is a node pertaining to both sets
7307 * When neither object to be compared is a node-set and the operator is
7617 * The context node of the traversal is specified via @contextNode.
7624 * Used for merging node sets in xmlXPathCollectAndTest().
7633 * @cur: the current node in the traversal
7636 * The self axis contains just the context node itself
7644 return(ctxt->context->node);
7651 * @cur: the current node in the traversal
7654 * The child axis contains the children of the context node in document order.
7662 if (ctxt->context->node == NULL) return(NULL);
7663 switch (ctxt->context->node->type) {
7673 return(ctxt->context->node->children);
7681 return(((xmlDocPtr) ctxt->context->node)->children);
7702 * @cur: the current node in the traversal
7705 * The child axis contains the children of the context node in document order.
7713 cur = ctxt->context->node;
7746 * Get the next sibling element node.
7758 /* case XML_DTD_NODE: */ /* URGENT TODO: DTD-node as well? */
7778 * @cur: the current node in the traversal
7855 * @cur: the current node in the traversal
7858 * the descendant axis contains the descendants of the context node in document
7867 if (ctxt->context->node == NULL)
7869 if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
7870 (ctxt->context->node->type == XML_NAMESPACE_DECL))
7873 if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
7875 return(ctxt->context->node->children);
7894 if (cur == ctxt->context->node) return(NULL);
7906 if (cur == ctxt->context->node) return(NULL);
7918 * @cur: the current node in the traversal
7921 * the descendant-or-self axis contains the context node and the descendants
7922 * of the context node in document order; thus the context node is the first
7923 * node on the axis, and the first child of the context node is the second node
7932 if (ctxt->context->node == NULL)
7934 if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
7935 (ctxt->context->node->type == XML_NAMESPACE_DECL))
7937 return(ctxt->context->node);
7946 * @cur: the current node in the traversal
7949 * The parent axis contains the parent of the context node, if there is one.
7957 * the parent of an attribute or namespace node is the element
7958 * to which the attribute or namespace node is attached
7962 if (ctxt->context->node == NULL) return(NULL);
7963 switch (ctxt->context->node->type) {
7978 if (ctxt->context->node->parent == NULL)
7980 if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
7981 ((ctxt->context->node->parent->name[0] == ' ') ||
7982 (xmlStrEqual(ctxt->context->node->parent->name,
7983 BAD_CAST "fake node libxslt"))))
7985 return(ctxt->context->node->parent);
7987 xmlAttrPtr att = (xmlAttrPtr) ctxt->context->node;
8000 xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
8015 * @cur: the current node in the traversal
8018 * the ancestor axis contains the ancestors of the context node; the ancestors
8019 * of the context node consist of the parent of context node and the parent's
8021 * parent is the first node on the axis, and the parent's parent is the second
8022 * node on the axis
8030 * the parent of an attribute or namespace node is the element
8031 * to which the attribute or namespace node is attached
8035 if (ctxt->context->node == NULL) return(NULL);
8036 switch (ctxt->context->node->type) {
8051 if (ctxt->context->node->parent == NULL)
8053 if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
8054 ((ctxt->context->node->parent->name[0] == ' ') ||
8055 (xmlStrEqual(ctxt->context->node->parent->name,
8056 BAD_CAST "fake node libxslt"))))
8058 return(ctxt->context->node->parent);
8060 xmlAttrPtr tmp = (xmlAttrPtr) ctxt->context->node;
8073 xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
8108 BAD_CAST "fake node libxslt"))))
8112 node;
8117 xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
8140 * @cur: the current node in the traversal
8143 * he ancestor-or-self axis contains the context node and ancestors of
8144 * the context node in reverse document order; thus the context node is
8145 * the first node on the axis, and the context node's parent the second;
8154 return(ctxt->context->node);
8161 * @cur: the current node in the traversal
8165 * node in document order.
8172 if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
8173 (ctxt->context->node->type == XML_NAMESPACE_DECL))
8178 return(ctxt->context->node->next);
8185 * @cur: the current node in the traversal
8189 * node in reverse document order; the first preceding sibling is first on the
8190 * axis; the sibling preceding that node is the second on the axis and so on.
8197 if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
8198 (ctxt->context->node->type == XML_NAMESPACE_DECL))
8203 return(ctxt->context->node->prev);
8207 return(ctxt->context->node->prev);
8215 * @cur: the current node in the traversal
8219 * node that are after the context node in document order, excluding any
8233 cur = ctxt->context->node;
8252 * @ancestor: the ancestor node
8253 * @node: the current node
8255 * Check that @ancestor is a @node's ancestor
8257 * returns 1 if @ancestor is a @node's ancestor, 0 otherwise.
8260 xmlXPathIsAncestor(xmlNodePtr ancestor, xmlNodePtr node) {
8261 if ((ancestor == NULL) || (node == NULL)) return(0);
8262 if (node->type == XML_NAMESPACE_DECL)
8267 if (ancestor->doc != node->doc) return(0);
8268 /* avoid searching if ancestor or node is the root node */
8269 if (ancestor == (xmlNodePtr) node->doc) return(1);
8270 if (node == (xmlNodePtr) ancestor->doc) return(0);
8271 while (node->parent != NULL) {
8272 if (node->parent == ancestor)
8274 node = node->parent;
8282 * @cur: the current node in the traversal
8286 * node that are before the context node in document order, excluding any
8297 cur = ctxt->context->node;
8318 } while (xmlXPathIsAncestor(cur, ctxt->context->node));
8325 * @cur: the current node in the traversal
8329 * node that are before the context node in document order, excluding any
8343 cur = ctxt->context->node;
8376 * the namespace axis contains the namespace nodes of the context node;
8378 * be empty unless the context node is an element
8380 * We keep the XML namespace node at the end of the list.
8387 if (ctxt->context->node->type != XML_ELEMENT_NODE) return(NULL);
8392 xmlGetNsList(ctxt->context->doc, ctxt->context->node);
8424 if (ctxt->context->node == NULL)
8426 if (ctxt->context->node->type != XML_ELEMENT_NODE)
8429 if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
8431 return((xmlNodePtr)ctxt->context->node->properties);
8461 ctxt->context->node = (xmlNodePtr) ctxt->context->doc;
8463 ctxt->context->node));
8481 * The last function returns the number of nodes in the context node list.
8506 * The position function returns the position of the context node in the
8507 * context node list. The first position is 1, and so the last position
8532 * number count(node-set)
8579 * Returns a node-set of selected elements.
8635 * node-set id(object)
8637 * (see [5.2.1 Unique IDs]). When the argument to id is of type node-set,
8639 * string value of each of the nodes in the argument node-set. When the
8643 * of characters matching the production S); the result is a node-set
8644 * containing the elements in the same document as the context node that
8695 * string local-name(node-set?)
8697 * of the name of the node in the argument node-set that is first in
8698 * document order. If the node-set is empty or the first node has no
8700 * defaults to the context node.
8710 ctxt->context->node));
8753 * string namespace-uri(node-set?)
8755 * namespace URI of the expanded name of the node in the argument
8756 * node-set that is first in document order. If the node-set is empty,
8757 * the first node has no name, or the expanded name has no namespace
8759 * defaults to the context node.
8769 ctxt->context->node));
8805 * string name(node-set?)
8807 * the name of the node in the argument node-set that is first in document
8809 * declarations in effect on the node whose name is being represented.
8812 * in effect on the node that associate multiple prefixes with the same
8817 * defaults to the context node.
8828 ctxt->context->node));
8888 * - A node-set is converted to a string by returning the value of
8889 * the node in the node-set that is first in document order.
8890 * If the node-set is empty, an empty string is returned.
8913 * If the argument is omitted, it defaults to a node-set with the
8914 * context node as its only member.
8924 xmlXPathCastNodeToString(ctxt->context->node)));
8943 * the context node converted to a string, in other words the value
8944 * of the context node.
8953 if (ctxt->context->node == NULL) {
8958 content = xmlXPathCastNodeToString(ctxt->context->node);
9310 * node converted to a string, in other words the value of the context node.
9321 /* Use current context node */
9324 xmlXPathCastNodeToString(ctxt->context->node)));
9458 * - a node-set is true if and only if it is non-empty
9526 * language of the context node as specified by xml:lang attributes
9528 * the argument string. The language of the context node is determined
9529 * by the value of the xml:lang attribute on the context node, or, if
9530 * the context node has no xml:lang attribute, by the value of the
9531 * xml:lang attribute on the nearest ancestor of the context node that
9552 theLang = xmlNodeGetLang(ctxt->context->node);
9583 if (ctxt->context->node == NULL) {
9586 xmlChar* content = xmlNodeGetContent(ctxt->context->node);
9606 * number sum(node-set)
9608 * the argument node-set.
10397 * | 'node'
10406 if (xmlStrEqual(name, BAD_CAST "node"))
10456 * Optimization for count(): we don't need the node-set to be sorted.
10536 * be filtered does not evaluate to a node-set. The context node list
10537 * used for evaluating the expression in square brackets is the node-set
10615 * does not evaluate to a node-set.
10618 * /descendant-or-self::node()/.
11034 * operations which don't require a sorted node-set.
11108 * | 'node'
11151 else if (xmlStrEqual(name, BAD_CAST "node"))
11316 * A location step of . is short for self::node(). This is
11319 * self::node()/descendant-or-self::node()/child::para
11321 * node.
11322 * Similarly, a location step of .. is short for parent::node().
11323 * For example, ../title is short for parent::node()/child::title
11325 * node.
11527 * // is short for /descendant-or-self::node()/. For example,
11528 * //para is short for /descendant-or-self::node()/child::para and
11531 * document element node is a child of the root node); div//para is
11532 * short for div/descendant-or-self::node()/child::para and so will
11697 * "For each node in the node-set to be filtered, the
11698 * PredicateExpr is evaluated with that node as the
11699 * context node, with the number of nodes in the
11700 * node-set as the context size, and with the proximity
11701 * position of the node in the node-set with respect to
11703 * @oldset is the node-set" to be filtered.
11709 * node-set context pos
11714 * node-set context pos
11718 oldContextNode = xpctxt->node;
11730 xpctxt->node = contextNode;
11742 * Evaluate the predicate expression with 1 context node
11743 * at a time; this node is packaged into a node set; this
11744 * node set is handed over to the evaluation mechanism.
11770 * Remove the entry from the initial node set.
11779 * context node, in order to avoid massive recreation
11804 xpctxt->node = oldContextNode;
11836 * Check if the node set contains a sufficient number of nodes for
11868 oldContextNode = xpctxt->node;
11881 xpctxt->node = contextNode;
11894 * Evaluate the predicate expression with 1 context node
11895 * at a time; this node is packaged into a node set; this
11896 * node set is handed over to the evaluation mechanism.
11938 * Only 1 node was requested.
11961 * Remove the entry from the initial node set.
11974 * context node, in order to avoid massive recreation
12004 xpctxt->node = oldContextNode;
12031 * - an expression selecting the node set.
12090 if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
12095 if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
12112 /* The set of context nodes for the node tests */
12116 /* The final resulting node set wrt to all context nodes */
12119 * The temporary resulting node set wrt 1 context node.
12184 * Optimization if an element node type is 'element'.
12256 * COLLECT 'child' 'name' 'node' foo -- op (we are here)
12261 * COLLECT 'parent' 'name' 'node' bar
12262 * NODE
12296 * 2.3 Node Tests
12297 * - For the attribute axis, the principal node type is attribute.
12298 * - For the namespace axis, the principal node type is namespace.
12299 * - For other axes, the principal node type is element.
12301 * A node test * is true for any node of the
12302 * principal node type. For example, child::* will
12303 * select all element children of the context node
12305 oldContextNode = xpctxt->node;
12315 xpctxt->node = contextSeq->nodeTab[contextIdx++];
12539 * no predicates existed and a node test succeeded.
12602 * Add the filtered set of nodes to the result node set.
12679 * Reset the context node.
12681 xpctxt->node = oldContextNode;
12730 * limit tree traversing to first node in the result
12736 * OPTIMIZE TODO: How do we know if the node-list wasn't
12772 ctxt->context->node));
12781 ctxt->context->node = NULL;
12850 bak = ctxt->context->node;
12861 * limit tree traversing to first node in the result
12871 ctxt->context->node = bak;
12907 ctxt->context->node));
12916 ctxt->context->node = NULL;
13019 oldnode = ctxt->context->node;
13036 ctxt->context->node = NULL;
13055 * Run the evaluation with a node list made of a
13058 ctxt->context->node = oldlocset->locTab[i]->user;
13063 ctxt->context->node);
13066 ctxt->context->node) < 0) {
13103 ctxt->context->node = NULL;
13105 * Only put the first node in the result, then leave.
13119 ctxt->context->node = NULL;
13123 ctxt->context->node = oldnode;
13137 oldnode = ctxt->context->node;
13139 ctxt->context->node = NULL;
13155 ctxt->context->node = oldnode;
13170 * Run the evaluation with a node list made of
13173 ctxt->context->node = oldset->nodeTab[i];
13179 ctxt->context->node);
13182 ctxt->context->node) < 0) {
13221 ctxt->context->node = NULL;
13223 * Only put the first node in the result, then leave.
13237 ctxt->context->node = NULL;
13244 ctxt->context->node = oldnode;
13276 bak = ctxt->context->node;
13286 ctxt->context->node = bak;
13302 bak = ctxt->context->node;
13312 ctxt->context->node = bak;
13328 bak = ctxt->context->node;
13334 ctxt->context->node = bak;
13347 bak = ctxt->context->node;
13353 ctxt->context->node = bak;
13363 bak = ctxt->context->node;
13370 ctxt->context->node = bak;
13389 bak = ctxt->context->node;
13395 ctxt->context->node = bak;
13409 bak = ctxt->context->node;
13415 ctxt->context->node = bak;
13448 ctxt->context->node));
13457 ctxt->context->node = NULL;
13577 bak = ctxt->context->node;
13584 ctxt->context->node = bak;
13590 ctxt->context->node = bak;
13697 * COLLECT 'parent' 'name' 'node' book
13698 * NODE
13710 node;
13728 ctxt->context->node = NULL;
13749 * Run the evaluation with a node list made of a
13752 ctxt->context->node = oldlocset->locTab[i]->user;
13756 ctxt->context->node);
13790 ctxt->context->node = NULL;
13797 ctxt->context->node = NULL;
13801 ctxt->context->node = oldnode;
13815 oldnode = ctxt->context->node;
13817 ctxt->context->node = NULL;
13833 ctxt->context->node = oldnode;
13845 * "For each node in the node-set to be filtered, the
13846 * PredicateExpr is evaluated with that node as the
13847 * context node, with the number of nodes in the
13848 * node-set as the context size, and with the proximity
13849 * position of the node in the node-set with respect to
13851 * @oldset is the node-set" to be filtered.
13857 * node-set context pos
13862 * node-set context pos
13866 * removed the first node in the node-set, then
13871 * Run the evaluation with a node list made of
13874 ctxt->context->node = oldset->nodeTab[i];
13880 ctxt->context->node);
13883 ctxt->context->node) < 0) {
13891 * Evaluate the predicate against the context node.
13936 ctxt->context->node = NULL;
13944 ctxt->context->node = NULL;
13952 ctxt->context->node = oldnode;
13994 ctxt->context->node = NULL;
14010 * Run the evaluation with a node list made of a
14013 ctxt->context->node = oldlocset->locTab[i]->user;
14017 ctxt->context->node);
14062 ctxt->context->node = NULL;
14068 ctxt->context->node = NULL;
14075 * Run the evaluation with a node list made of a single item
14078 ctxt->context->node = oldset->nodeTab[i];
14083 ctxt->context->node);
14114 ctxt->context->node = NULL;
14123 ctxt->context->node = NULL;
14282 /* Select "self::node()" */
14285 xmlXPathNodeSetAddUnique((*resultSeq)->nodesetval, ctxt->node);
14294 } else if (ctxt->node != NULL) {
14295 switch (ctxt->node->type) {
14303 cur = ctxt->node;
14548 * Evaluate a predicate result for the current node.
14552 * context node in the context node list (as returned by the position
14586 * Evaluate a predicate result for the current node.
14590 * context node in the context node list (as returned by the position
14718 * Try to rewrite "descendant-or-self::node()/foo" to an optimized
14735 * This is a "descendant-or-self::node()" without predicates.
14743 * Convert "descendant-or-self::node()/child::" or
14744 * "descendant-or-self::node()/descendant::" to
14753 * Convert "descendant-or-self::node()/self::" or
14754 * "descendant-or-self::node()/descendant-or-self::" to
15083 * @node: the node to to use as the context node
15086 * Sets 'node' as the context node. The node must be in the same
15092 xmlXPathSetContextNode(xmlNodePtr node, xmlXPathContextPtr ctx) {
15093 if ((node == NULL) || (ctx == NULL))
15096 if (node->doc == ctx->doc) {
15097 ctx->node = node;
15105 * @node: the node to to use as the context node
15109 * Evaluate the XPath Location Path in the given context. The node 'node'
15110 * is set as the context node. The context node is not restored.
15116 xmlXPathNodeEval(xmlNodePtr node, const xmlChar *str, xmlXPathContextPtr ctx) {
15119 if (xmlXPathSetContextNode(node, ctx) < 0)