Lines Matching refs:cur
347 ctxt->cur - ctxt->base, 0,
360 ctxt->context->lastError.int1 = ctxt->cur - ctxt->base;
371 ctxt->cur - ctxt->base, 0,
621 xmlXPathCompExprPtr cur;
623 cur = (xmlXPathCompExprPtr) xmlMalloc(sizeof(xmlXPathCompExpr));
624 if (cur == NULL) {
628 memset(cur, 0, sizeof(xmlXPathCompExpr));
629 cur->maxStep = 10;
630 cur->nbStep = 0;
631 cur->steps = (xmlXPathStepOp *) xmlMalloc(cur->maxStep *
633 if (cur->steps == NULL) {
635 xmlFree(cur);
638 cur->steps, 0, cur->maxStep * sizeof(xmlXPathStepOp));
639 cur->last = -1;
641 cur->nb = 0;
643 return(cur);
874 xmlXPathDebugDumpNode(FILE *output, xmlNodePtr cur, int depth) {
881 if (cur == NULL) {
888 if ((cur->type == XML_DOCUMENT_NODE) ||
889 (cur->type == XML_HTML_DOCUMENT_NODE)) {
892 } else if (cur->type == XML_ATTRIBUTE_NODE)
893 xmlDebugDumpAttr(output, (xmlAttrPtr)cur, depth);
895 xmlDebugDumpOneNode(output, cur, depth);
898 xmlXPathDebugDumpNodeList(FILE *output, xmlNodePtr cur, int depth) {
906 if (cur == NULL) {
913 while (cur != NULL) {
914 tmp = cur;
915 cur = cur->next;
921 xmlXPathDebugDumpNodeSet(FILE *output, xmlNodeSetPtr cur, int depth) {
929 if (cur == NULL) {
936 if (cur != NULL) {
937 fprintf(output, "Set contains %d nodes:\n", cur->nodeNr);
938 for (i = 0;i < cur->nodeNr;i++) {
941 xmlXPathDebugDumpNode(output, cur->nodeTab[i], depth + 1);
947 xmlXPathDebugDumpValueTree(FILE *output, xmlNodeSetPtr cur, int depth) {
955 if ((cur == NULL) || (cur->nodeNr == 0) || (cur->nodeTab[0] == NULL)) {
964 xmlXPathDebugDumpNodeList(output, cur->nodeTab[0]->children, depth + 1);
968 xmlXPathDebugDumpLocationSet(FILE *output, xmlLocationSetPtr cur, int depth) {
976 if (cur == NULL) {
983 for (i = 0;i < cur->locNr;i++) {
986 xmlXPathDebugDumpObject(output, cur->locTab[i], depth + 1);
994 * @cur: the object to inspect
1000 xmlXPathDebugDumpObject(FILE *output, xmlXPathObjectPtr cur, int depth) {
1013 if (cur == NULL) {
1017 switch(cur->type) {
1023 xmlXPathDebugDumpNodeSet(output, cur->nodesetval, depth);
1027 xmlXPathDebugDumpValueTree(output, cur->nodesetval, depth);
1031 if (cur->boolval) fprintf(output, "true\n");
1035 switch (xmlXPathIsInf(cur->floatval)) {
1043 if (xmlXPathIsNaN(cur->floatval)) {
1045 } else if (cur->floatval == 0 && xmlXPathGetSign(cur->floatval) != 0) {
1048 fprintf(output, "Object is a number : %0g\n", cur->floatval);
1054 xmlDebugDumpString(output, cur->stringval);
1058 fprintf(output, "Object is a point : index %d in node", cur->index);
1059 xmlXPathDebugDumpNode(output, (xmlNodePtr) cur->user, depth + 1);
1063 if ((cur->user2 == NULL) ||
1064 ((cur->user2 == cur->user) && (cur->index == cur->index2))) {
1067 if (cur->index >= 0)
1068 fprintf(output, "index %d in ", cur->index);
1070 xmlXPathDebugDumpNode(output, (xmlNodePtr) cur->user,
1076 if (cur->index >= 0)
1077 fprintf(output, "index %d in ", cur->index);
1079 xmlXPathDebugDumpNode(output, (xmlNodePtr) cur->user,
1083 if (cur->index2 >= 0)
1084 fprintf(output, "index %d in ", cur->index2);
1086 xmlXPathDebugDumpNode(output, (xmlNodePtr) cur->user2,
1095 (xmlLocationSetPtr) cur->user, depth);
2607 * CUR returns the current xmlChar value, i.e. a 8 bit value
2612 * NXT(n) returns the n'th next xmlChar. Same as CUR is should be used only
2623 #define CUR (*ctxt->cur)
2624 #define SKIP(val) ctxt->cur += (val)
2625 #define NXT(val) ctxt->cur[(val)]
2626 #define CUR_PTR ctxt->cur
2633 #define NEXTL(l) ctxt->cur += l
2636 while (IS_BLANK_CH(*(ctxt->cur))) NEXT
2638 #define CURRENT (*ctxt->cur)
2639 #define NEXT ((*ctxt->cur) ? ctxt->cur++: ctxt->cur)
2685 char *ptr, *cur;
2693 cur = &work[0];
2694 while ((*cur) && (ptr - buffer < buffersize)) {
2695 *ptr++ = *cur++;
2798 xmlNodePtr cur;
2802 cur = doc->children;
2803 while (cur != NULL) {
2804 if (cur->type == XML_ELEMENT_NODE) {
2805 cur->content = (void *) (-(++count));
2806 if (cur->children != NULL) {
2807 cur = cur->children;
2811 if (cur->next != NULL) {
2812 cur = cur->next;
2816 cur = cur->parent;
2817 if (cur == NULL)
2819 if (cur == (xmlNodePtr) doc) {
2820 cur = NULL;
2823 if (cur->next != NULL) {
2824 cur = cur->next;
2827 } while (cur != NULL);
2847 xmlNodePtr cur, root;
2870 cur = attrNode2->prev;
2871 while (cur != NULL) {
2872 if (cur == attrNode1)
2874 cur = cur->prev;
2913 for (depth2 = 0, cur = node2;cur->parent != NULL;cur = cur->parent) {
2914 if (cur == node1)
2918 root = cur;
2919 for (depth1 = 0, cur = node1;cur->parent != NULL;cur = cur->parent) {
2920 if (cur == node2)
2927 if (root != cur) {
2973 for (cur = node1->next;cur != NULL;cur = cur->next)
2974 if (cur == node2)
2996 xmlNodePtr cur, root;
3131 cur = miscNode2->prev;
3132 while (cur != NULL) {
3133 if (cur == miscNode1)
3135 if (cur->type == XML_ELEMENT_NODE)
3137 cur = cur->prev;
3162 cur = node1->parent;
3163 while (cur) {
3164 if (cur == node2)
3166 cur = cur->parent;
3170 cur = node2->parent;
3171 while (cur) {
3172 if (cur == node1)
3174 cur = cur->parent;
3205 for (depth2 = 0, cur = node2;cur->parent != NULL;cur = cur->parent) {
3206 if (cur == node1)
3210 root = cur;
3211 for (depth1 = 0, cur = node1;cur->parent != NULL;cur = cur->parent) {
3212 if (cur == node2)
3219 if (root != cur) {
3264 for (cur = node1->next;cur != NULL;cur = cur->next)
3265 if (cur == node2)
3324 xmlNsPtr cur;
3334 cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
3335 if (cur == NULL) {
3339 memset(cur, 0, sizeof(xmlNs));
3340 cur->type = XML_NAMESPACE_DECL;
3342 cur->href = xmlStrdup(ns->href);
3344 cur->prefix = xmlStrdup(ns->prefix);
3345 cur->next = (xmlNsPtr) node;
3346 return((xmlNodePtr) cur);
3444 * @cur: the node-set
3447 * checks whether @cur contains @val
3449 * Returns true (1) if @cur contains @val, false (0) otherwise
3452 xmlXPathNodeSetContains (xmlNodeSetPtr cur, xmlNodePtr val) {
3455 if ((cur == NULL) || (val == NULL)) return(0);
3457 for (i = 0; i < cur->nodeNr; i++) {
3458 if (cur->nodeTab[i]->type == XML_NAMESPACE_DECL) {
3462 ns2 = (xmlNsPtr) cur->nodeTab[i];
3471 for (i = 0; i < cur->nodeNr; i++) {
3472 if (cur->nodeTab[i] == val)
3481 * @cur: the initial node set
3488 xmlXPathNodeSetAddNs(xmlNodeSetPtr cur, xmlNodePtr node, xmlNsPtr ns) {
3492 if ((cur == NULL) || (ns == NULL) || (node == NULL) ||
3501 for (i = 0;i < cur->nodeNr;i++) {
3502 if ((cur->nodeTab[i] != NULL) &&
3503 (cur->nodeTab[i]->type == XML_NAMESPACE_DECL) &&
3504 (((xmlNsPtr)cur->nodeTab[i])->next == (xmlNsPtr) node) &&
3505 (xmlStrEqual(ns->prefix, ((xmlNsPtr)cur->nodeTab[i])->prefix)))
3512 if (cur->nodeMax == 0) {
3513 cur->nodeTab = (xmlNodePtr *) xmlMalloc(XML_NODESET_DEFAULT *
3515 if (cur->nodeTab == NULL) {
3519 memset(cur->nodeTab, 0 ,
3521 cur->nodeMax = XML_NODESET_DEFAULT;
3522 } else if (cur->nodeNr == cur->nodeMax) {
3525 cur->nodeMax *= 2;
3526 temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax *
3532 cur->nodeTab = temp;
3534 cur->nodeTab[cur->nodeNr++] = xmlXPathNodeSetDupNs(node, ns);
3539 * @cur: the initial node set
3545 xmlXPathNodeSetAdd(xmlNodeSetPtr cur, xmlNodePtr val) {
3548 if ((cur == NULL) || (val == NULL)) return;
3559 for (i = 0;i < cur->nodeNr;i++)
3560 if (cur->nodeTab[i] == val) return;
3565 if (cur->nodeMax == 0) {
3566 cur->nodeTab = (xmlNodePtr *) xmlMalloc(XML_NODESET_DEFAULT *
3568 if (cur->nodeTab == NULL) {
3572 memset(cur->nodeTab, 0 ,
3574 cur->nodeMax = XML_NODESET_DEFAULT;
3575 } else if (cur->nodeNr == cur->nodeMax) {
3578 cur->nodeMax *= 2;
3579 temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax *
3585 cur->nodeTab = temp;
3590 cur->nodeTab[cur->nodeNr++] =
3593 cur->nodeTab[cur->nodeNr++] = val;
3598 * @cur: the initial node set
3605 xmlXPathNodeSetAddUnique(xmlNodeSetPtr cur, xmlNodePtr val) {
3606 if ((cur == NULL) || (val == NULL)) return;
3617 if (cur->nodeMax == 0) {
3618 cur->nodeTab = (xmlNodePtr *) xmlMalloc(XML_NODESET_DEFAULT *
3620 if (cur->nodeTab == NULL) {
3624 memset(cur->nodeTab, 0 ,
3626 cur->nodeMax = XML_NODESET_DEFAULT;
3627 } else if (cur->nodeNr == cur->nodeMax) {
3630 cur->nodeMax *= 2;
3631 temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax *
3637 cur->nodeTab = temp;
3642 cur->nodeTab[cur->nodeNr++] =
3645 cur->nodeTab[cur->nodeNr++] = val;
4012 * @cur: the initial node set
4018 xmlXPathNodeSetDel(xmlNodeSetPtr cur, xmlNodePtr val) {
4021 if (cur == NULL) return;
4027 for (i = 0;i < cur->nodeNr;i++)
4028 if (cur->nodeTab[i] == val) break;
4030 if (i >= cur->nodeNr) { /* not found */
4038 if ((cur->nodeTab[i] != NULL) &&
4039 (cur->nodeTab[i]->type == XML_NAMESPACE_DECL))
4040 xmlXPathNodeSetFreeNs((xmlNsPtr) cur->nodeTab[i]);
4041 cur->nodeNr--;
4042 for (;i < cur->nodeNr;i++)
4043 cur->nodeTab[i] = cur->nodeTab[i + 1];
4044 cur->nodeTab[cur->nodeNr] = NULL;
4049 * @cur: the initial node set
4055 xmlXPathNodeSetRemove(xmlNodeSetPtr cur, int val) {
4056 if (cur == NULL) return;
4057 if (val >= cur->nodeNr) return;
4058 if ((cur->nodeTab[val] != NULL) &&
4059 (cur->nodeTab[val]->type == XML_NAMESPACE_DECL))
4060 xmlXPathNodeSetFreeNs((xmlNsPtr) cur->nodeTab[val]);
4061 cur->nodeNr--;
4062 for (;val < cur->nodeNr;val++)
4063 cur->nodeTab[val] = cur->nodeTab[val + 1];
4064 cur->nodeTab[cur->nodeNr] = NULL;
4357 xmlNodePtr cur;
4369 cur = xmlXPathNodeSetItem(nodes1, i);
4370 if (!xmlXPathNodeSetContains(nodes2, cur))
4371 xmlXPathNodeSetAddUnique(ret, cur);
4391 xmlNodePtr cur;
4403 cur = xmlXPathNodeSetItem(nodes1, i);
4404 if (xmlXPathNodeSetContains(nodes2, cur))
4405 xmlXPathNodeSetAddUnique(ret, cur);
4426 xmlNodePtr cur;
4437 cur = xmlXPathNodeSetItem(nodes, i);
4438 strval = xmlXPathCastNodeToString(cur);
4441 xmlXPathNodeSetAddUnique(ret, cur);
4485 xmlNodePtr cur;
4493 cur = xmlXPathNodeSetItem(nodes1, i);
4494 if (xmlXPathNodeSetContains(nodes2, cur))
4515 xmlNodePtr cur;
4530 cur = xmlXPathNodeSetItem(nodes, i);
4531 if (cur == node)
4533 xmlXPathNodeSetAddUnique(ret, cur);
4619 xmlNodePtr cur;
4634 cur = xmlXPathNodeSetItem(nodes, i);
4635 if (cur == node)
4637 xmlXPathNodeSetAddUnique(ret, cur);
5305 xmlNodePtr cur, tmp;
5315 cur = val->nodesetval->nodeTab[0]->children;
5316 while (cur != NULL) {
5317 tmp = xmlDocCopyNode(cur, top, 1);
5319 cur = cur->next;
6107 ret->cur = ret->base = str;
7493 (xmlXPathParserContextPtr ctxt, xmlNodePtr cur);
7503 (xmlNodePtr cur, xmlNodePtr contextNode);
7516 * @cur: the current node in the traversal
7524 xmlXPathNextSelf(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
7526 if (cur == NULL)
7534 * @cur: the current node in the traversal
7542 xmlXPathNextChild(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
7544 if (cur == NULL) {
7576 if ((cur->type == XML_DOCUMENT_NODE) ||
7577 (cur->type == XML_HTML_DOCUMENT_NODE))
7579 return(cur->next);
7585 * @cur: the current node in the traversal
7593 xmlXPathNextChildElement(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
7595 if (cur == NULL) {
7596 cur = ctxt->context->node;
7597 if (cur == NULL) return(NULL);
7601 switch (cur->type) {
7606 cur = cur->children;
7607 if (cur != NULL) {
7608 if (cur->type == XML_ELEMENT_NODE)
7609 return(cur);
7611 cur = cur->next;
7612 } while ((cur != NULL) &&
7613 (cur->type != XML_ELEMENT_NODE));
7614 return(cur);
7622 return(xmlDocGetRootElement((xmlDocPtr) cur));
7631 switch (cur->type) {
7645 if (cur->next != NULL) {
7646 if (cur->next->type == XML_ELEMENT_NODE)
7647 return(cur->next);
7648 cur = cur->next;
7650 cur = cur->next;
7651 } while ((cur != NULL) && (cur->type != XML_ELEMENT_NODE));
7652 return(cur);
7660 * @cur: the current node in the traversal
7670 xmlXPathNextDescendantOrSelfElemParent(xmlNodePtr cur,
7673 if (cur == NULL) {
7691 xmlNodePtr start = cur;
7693 while (cur != NULL) {
7694 switch (cur->type) {
7699 if (cur != start)
7700 return(cur);
7701 if (cur->children != NULL) {
7702 cur = cur->children;
7712 if (cur != start)
7713 return(cur);
7714 return(xmlDocGetRootElement((xmlDocPtr) cur));
7720 if ((cur == NULL) || (cur == contextNode))
7722 if (cur->next != NULL) {
7723 cur = cur->next;
7725 cur = cur->parent;
7736 * @cur: the current node in the traversal
7745 xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
7747 if (cur == NULL) {
7759 if (cur->children != NULL) {
7763 if (cur->children->type != XML_ENTITY_DECL) {
7764 cur = cur->children;
7768 if (cur->type != XML_DTD_NODE)
7769 return(cur);
7773 if (cur == ctxt->context->node) return(NULL);
7775 while (cur->next != NULL) {
7776 cur = cur->next;
7777 if ((cur->type != XML_ENTITY_DECL) &&
7778 (cur->type != XML_DTD_NODE))
7779 return(cur);
7783 cur = cur->parent;
7784 if (cur == NULL) break;
7785 if (cur == ctxt->context->node) return(NULL);
7786 if (cur->next != NULL) {
7787 cur = cur->next;
7788 return(cur);
7790 } while (cur != NULL);
7791 return(cur);
7797 * @cur: the current node in the traversal
7808 xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
7810 if (cur == NULL) {
7819 return(xmlXPathNextDescendant(ctxt, cur));
7825 * @cur: the current node in the traversal
7833 xmlXPathNextParent(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
7840 if (cur == NULL) {
7894 * @cur: the current node in the traversal
7906 xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
7913 if (cur == NULL) {
7963 if (cur == ctxt->context->doc->children)
7965 if (cur == (xmlNodePtr) ctxt->context->doc)
7967 switch (cur->type) {
7982 if (cur->parent == NULL)
7984 if ((cur->parent->type == XML_ELEMENT_NODE) &&
7985 ((cur->parent->name[0] == ' ') ||
7986 (xmlStrEqual(cur->parent->name,
7989 return(cur->parent);
8019 * @cur: the current node in the traversal
8030 xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
8032 if (cur == NULL)
8034 return(xmlXPathNextAncestor(ctxt, cur));
8040 * @cur: the current node in the traversal
8049 xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
8054 if (cur == (xmlNodePtr) ctxt->context->doc)
8056 if (cur == NULL)
8058 return(cur->next);
8064 * @cur: the current node in the traversal
8074 xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
8079 if (cur == (xmlNodePtr) ctxt->context->doc)
8081 if (cur == NULL)
8083 if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE)) {
8084 cur = cur->prev;
8085 if (cur == NULL)
8088 return(cur->prev);
8094 * @cur: the current node in the traversal
8105 xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
8107 if (cur != NULL && cur->children != NULL)
8108 return cur->children ;
8109 if (cur == NULL) cur = ctxt->context->node;
8110 if (cur == NULL) return(NULL) ; /* ERROR */
8111 if (cur->next != NULL) return(cur->next) ;
8113 cur = cur->parent;
8114 if (cur == NULL) break;
8115 if (cur == (xmlNodePtr) ctxt->context->doc) return(NULL);
8116 if (cur->next != NULL) return(cur->next);
8117 } while (cur != NULL);
8118 return(cur);
8149 * @cur: the current node in the traversal
8160 xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt, xmlNodePtr cur)
8163 if (cur == NULL)
8164 cur = ctxt->context->node;
8165 if (cur == NULL)
8167 if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE))
8168 cur = cur->prev;
8170 if (cur->prev != NULL) {
8171 for (cur = cur->prev; cur->last != NULL; cur = cur->last) ;
8172 return (cur);
8175 cur = cur->parent;
8176 if (cur == NULL)
8178 if (cur == ctxt->context->doc->children)
8180 } while (xmlXPathIsAncestor(cur, ctxt->context->node));
8181 return (cur);
8187 * @cur: the current node in the traversal
8201 xmlNodePtr cur)
8204 if (cur == NULL) {
8205 cur = ctxt->context->node;
8206 if (cur == NULL)
8208 if (cur->type == XML_NAMESPACE_DECL)
8209 cur = (xmlNodePtr)((xmlNsPtr)cur)->next;
8210 ctxt->ancestor = cur->parent;
8212 if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE))
8213 cur = cur->prev;
8214 while (cur->prev == NULL) {
8215 cur = cur->parent;
8216 if (cur == NULL)
8218 if (cur == ctxt->context->doc->children)
8220 if (cur != ctxt->ancestor)
8221 return (cur);
8222 ctxt->ancestor = cur->parent;
8224 cur = cur->prev;
8225 while (cur->last != NULL)
8226 cur = cur->last;
8227 return (cur);
8233 * @cur: the current attribute in the traversal
8245 xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
8248 if (ctxt->context->tmpNsList == NULL && cur != (xmlNodePtr) xmlXPathXMLNamespace) {
8274 * @cur: the current attribute in the traversal
8282 xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
8288 if (cur == NULL) {
8293 return((xmlNodePtr)cur->next);
8396 xmlXPathObjectPtr cur;
8403 cur = valuePop(ctxt);
8405 if ((cur == NULL) || (cur->nodesetval == NULL))
8407 else if ((cur->type == XPATH_NODESET) || (cur->type == XPATH_XSLT_TREE)) {
8409 (double) cur->nodesetval->nodeNr));
8411 if ((cur->nodesetval->nodeNr != 1) ||
8412 (cur->nodesetval->nodeTab == NULL)) {
8418 tmp = cur->nodesetval->nodeTab[0];
8429 xmlXPathReleaseObject(ctxt->context, cur);
8444 const xmlChar *cur = ids;
8455 while (IS_BLANK_CH(*cur)) cur++;
8456 while (*cur != 0) {
8457 while ((!IS_BLANK_CH(*cur)) && (*cur != 0))
8458 cur++;
8460 ID = xmlStrndup(ids, cur - ids);
8483 while (IS_BLANK_CH(*cur)) cur++;
8484 ids = cur;
8564 xmlXPathObjectPtr cur;
8579 cur = valuePop(ctxt);
8581 if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
8585 switch (cur->nodesetval->nodeTab[i]->type) {
8589 if (cur->nodesetval->nodeTab[i]->name[0] == ' ')
8594 cur->nodesetval->nodeTab[i]->name));
8598 ((xmlNsPtr)cur->nodesetval->nodeTab[i])->prefix));
8604 xmlXPathReleaseObject(ctxt->context, cur);
8623 xmlXPathObjectPtr cur;
8637 cur = valuePop(ctxt);
8639 if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
8643 switch (cur->nodesetval->nodeTab[i]->type) {
8646 if (cur->nodesetval->nodeTab[i]->ns == NULL)
8650 cur->nodesetval->nodeTab[i]->ns->href));
8656 xmlXPathReleaseObject(ctxt->context, cur);
8684 xmlXPathObjectPtr cur;
8697 cur = valuePop(ctxt);
8699 if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
8704 switch (cur->nodesetval->nodeTab[i]->type) {
8707 if (cur->nodesetval->nodeTab[i]->name[0] == ' ')
8710 else if ((cur->nodesetval->nodeTab[i]->ns == NULL) ||
8711 (cur->nodesetval->nodeTab[i]->ns->prefix == NULL)) {
8714 cur->nodesetval->nodeTab[i]->name));
8718 fullname = xmlBuildQName(cur->nodesetval->nodeTab[i]->name,
8719 cur->nodesetval->nodeTab[i]->ns->prefix,
8721 if (fullname == cur->nodesetval->nodeTab[i]->name)
8722 fullname = xmlStrdup(cur->nodesetval->nodeTab[i]->name);
8732 cur->nodesetval->nodeTab[i]));
8736 xmlXPathReleaseObject(ctxt->context, cur);
8778 xmlXPathObjectPtr cur;
8789 cur = valuePop(ctxt);
8790 if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
8791 valuePush(ctxt, xmlXPathCacheConvertString(ctxt->context, cur));
8808 xmlXPathObjectPtr cur;
8828 cur = valuePop(ctxt);
8830 xmlUTF8Strlen(cur->stringval)));
8831 xmlXPathReleaseObject(ctxt->context, cur);
8845 xmlXPathObjectPtr cur, newobj;
8854 cur = valuePop(ctxt);
8855 if ((cur == NULL) || (cur->type != XPATH_STRING)) {
8856 xmlXPathReleaseObject(ctxt->context, cur);
8866 xmlXPathReleaseObject(ctxt->context, cur);
8869 tmp = xmlStrcat(newobj->stringval, cur->stringval);
8870 newobj->stringval = cur->stringval;
8871 cur->stringval = tmp;
8875 valuePush(ctxt, cur);
9321 xmlXPathObjectPtr cur;
9324 cur = valuePop(ctxt);
9325 if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
9326 cur = xmlXPathCacheConvertBoolean(ctxt->context, cur);
9327 valuePush(ctxt, cur);
9436 xmlXPathObjectPtr cur;
9454 cur = valuePop(ctxt);
9455 valuePush(ctxt, xmlXPathCacheConvertNumber(ctxt->context, cur));
9470 xmlXPathObjectPtr cur;
9479 cur = valuePop(ctxt);
9481 if ((cur->nodesetval != NULL) && (cur->nodesetval->nodeNr != 0)) {
9482 for (i = 0; i < cur->nodesetval->nodeNr; i++) {
9483 res += xmlXPathCastNodeToNumber(cur->nodesetval->nodeTab[i]);
9487 xmlXPathReleaseObject(ctxt->context, cur);
9626 * @cur: pointer to the beginning of the char
9639 const xmlChar *cur;
9643 cur = ctxt->cur;
9656 c = *cur;
9658 if ((cur[1] & 0xc0) != 0x80)
9662 if ((cur[2] & 0xc0) != 0x80)
9666 ((cur[3] & 0xc0) != 0x80))
9670 val = (cur[0] & 0x7) << 18;
9671 val |= (cur[1] & 0x3f) << 12;
9672 val |= (cur[2] & 0x3f) << 6;
9673 val |= cur[3] & 0x3f;
9677 val = (cur[0] & 0xf) << 12;
9678 val |= (cur[1] & 0x3f) << 6;
9679 val |= cur[2] & 0x3f;
9684 val = (cur[0] & 0x1f) << 6;
9685 val |= cur[1] & 0x3f;
9694 return((int) *cur);
9728 if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
9732 in = ctxt->cur;
9746 count = in - ctxt->cur;
9749 ret = xmlStrndup(ctxt->cur, count);
9750 ctxt->cur = in;
9781 if (ret && CUR == ':') {
9809 if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
9813 in = ctxt->cur;
9825 count = in - ctxt->cur;
9826 ret = xmlStrndup(ctxt->cur, count);
9827 ctxt->cur = in;
9934 const xmlChar *cur = str;
9944 if (cur == NULL) return(0);
9945 while (IS_BLANK_CH(*cur)) cur++;
9946 if ((*cur != '.') && ((*cur < '0') || (*cur > '9')) && (*cur != '-')) {
9949 if (*cur == '-') {
9951 cur++;
9960 while ((*cur >= '0') && (*cur <= '9')) {
9962 tmp = (*cur - '0');
9964 cur++;
9970 while ((*cur >= '0') && (*cur <= '9')) {
9971 ret = ret * 10 + (*cur - '0');
9973 cur++;
9977 if (*cur == '.') {
9981 cur++;
9982 if (((*cur < '0') || (*cur > '9')) && (!ok)) {
9985 while (((*cur >= '0') && (*cur <= '9')) && (frac < MAX_FRAC)) {
9986 v = (*cur - '0');
9989 cur++;
9993 while ((*cur >= '0') && (*cur <= '9'))
9994 cur++;
9996 if ((*cur == 'e') || (*cur == 'E')) {
9997 cur++;
9998 if (*cur == '-') {
10000 cur++;
10001 } else if (*cur == '+') {
10002 cur++;
10004 while ((*cur >= '0') && (*cur <= '9')) {
10005 exponent = exponent * 10 + (*cur - '0');
10006 cur++;
10009 while (IS_BLANK_CH(*cur)) cur++;
10010 if (*cur != 0) return(xmlXPathNAN);
10042 if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
10051 while ((CUR >= '0') && (CUR <= '9')) {
10053 tmp = (CUR - '0');
10061 while ((CUR >= '0') && (CUR <= '9')) {
10062 ret = ret * 10 + (CUR - '0');
10067 if (CUR == '.') {
10069 if (((CUR < '0') || (CUR > '9')) && (!ok)) {
10072 while ((CUR >= '0') && (CUR <= '9')) {
10074 ret = ret + (CUR - '0') * mult;
10078 if ((CUR == 'e') || (CUR == 'E')) {
10080 if (CUR == '-') {
10083 } else if (CUR == '+') {
10086 while ((CUR >= '0') && (CUR <= '9')) {
10087 exponent = exponent * 10 + (CUR - '0');
10114 if (CUR == '"') {
10117 while ((IS_CHAR_CH(CUR)) && (CUR != '"'))
10119 if (!IS_CHAR_CH(CUR)) {
10125 } else if (CUR == '\'') {
10128 while ((IS_CHAR_CH(CUR)) && (CUR != '\''))
10130 if (!IS_CHAR_CH(CUR)) {
10158 if (CUR == '"') {
10161 while ((IS_CHAR_CH(CUR)) && (CUR != '"'))
10163 if (!IS_CHAR_CH(CUR)) {
10169 } else if (CUR == '\'') {
10172 while ((IS_CHAR_CH(CUR)) && (CUR != '\''))
10174 if (!IS_CHAR_CH(CUR)) {
10212 if (CUR != '$') {
10290 if (CUR != '(') {
10305 if (CUR != ')') {
10306 while (CUR != 0) {
10317 if (CUR == ')') break;
10318 if (CUR != ',') {
10346 if (CUR == '$') xmlXPathCompVariableReference(ctxt);
10347 else if (CUR == '(') {
10352 if (CUR != ')') {
10357 } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
10359 } else if ((CUR == '\'') || (CUR == '"')) {
10388 while (CUR == '[') {
10417 const xmlChar *cur;
10420 cur = ctxt->cur;
10439 ret = xmlStrndup(cur, ctxt->cur - cur);
10440 ctxt->cur = cur;
10468 if ((CUR == '$') || (CUR == '(') ||
10469 (IS_ASCII_DIGIT(CUR)) ||
10470 (CUR == '\'') || (CUR == '"') ||
10471 (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
10473 } else if (CUR == '*') {
10476 } else if (CUR == '/') {
10479 } else if (CUR == '@') {
10482 } else if (CUR == '.') {
10579 if (CUR == '/') {
10588 if ((CUR == '/') && (NXT(1) == '/')) {
10597 } else if (CUR == '/') {
10619 while (CUR == '|') {
10649 while (CUR == '-') {
10684 while ((CUR == '*') ||
10685 ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
10686 ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
10690 if (CUR == '*') {
10693 } else if (CUR == 'd') {
10696 } else if (CUR == 'm') {
10725 while ((CUR == '+') || (CUR == '-')) {
10729 if (CUR == '+') plus = 1;
10763 while ((CUR == '<') ||
10764 (CUR == '>') ||
10765 ((CUR == '<') && (NXT(1) == '=')) ||
10766 ((CUR == '>') && (NXT(1) == '='))) {
10770 if (CUR == '<') inf = 1;
10805 while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
10809 if (CUR == '=') eq = 1;
10836 while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
10862 while ((CUR == 'o') && (NXT(1) == 'r')) {
10898 if (CUR != '[') {
10920 if (CUR != ']') {
10969 if ((name == NULL) && (CUR == '*')) {
10984 blanks = IS_BLANK_CH(CUR);
10986 if (CUR == '(') {
11015 if (CUR != ')') {
11022 if (CUR != ')') {
11031 if ((!blanks) && (CUR == ':')) {
11052 if (CUR == '*') {
11177 if ((CUR == '.') && (NXT(1) == '.')) {
11182 } else if (CUR == '.') {
11203 if (CUR != '(') {
11214 if (CUR != ')') {
11223 if (CUR == '*') {
11232 if ((CUR == ':') && (NXT(1) == ':')) {
11243 } else if (CUR == '@') {
11285 while (CUR == '[') {
11325 if ((CUR == '/') && (NXT(1) == '/')) {
11330 } else if (CUR == '/') {
11336 while (CUR == '/') {
11337 if ((CUR == '/') && (NXT(1) == '/')) {
11343 } else if (CUR == '/') {
11376 if (CUR != '/') {
11379 while (CUR == '/') {
11380 if ((CUR == '/') && (NXT(1) == '/')) {
11386 } else if (CUR == '/') {
11389 if ((CUR != 0 ) &&
11390 ((IS_ASCII_LETTER(CUR)) || (CUR == '_') || (CUR == '.') ||
11391 (CUR == '@') || (CUR == '*')))
11897 addNode(seq, cur); \
11900 addNode(seq, cur); \
11907 xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur); \
11912 xpctxt->node, (xmlNsPtr) cur); \
11941 xmlNodePtr cur;
12175 cur = NULL;
12178 cur = next(ctxt, cur);
12179 if (cur == NULL)
12186 if (*first == cur)
12190 (xmlXPathCmpNodesExt(*first, cur) >= 0))
12192 (xmlXPathCmpNodes(*first, cur) >= 0))
12199 if (*last == cur)
12203 (xmlXPathCmpNodesExt(cur, *last) >= 0))
12205 (xmlXPathCmpNodes(cur, *last) >= 0))
12215 xmlGenericError(xmlGenericErrorContext, " %s", cur->name);
12230 switch (cur->type) {
12248 } else if (cur->type == type) {
12254 (cur->type == XML_CDATA_SECTION_NODE))
12260 if ((cur->type == XML_PI_NODE) &&
12261 ((name == NULL) || xmlStrEqual(name, cur->name)))
12268 if (cur->type == XML_ATTRIBUTE_NODE)
12273 if (cur->type == XML_NAMESPACE_DECL)
12278 if (cur->type == XML_ELEMENT_NODE) {
12283 } else if ((cur->ns != NULL) &&
12284 (xmlStrEqual(URI, cur->ns->href)))
12297 if (cur->type != XML_ATTRIBUTE_NODE)
12300 if (cur->type != XML_NAMESPACE_DECL)
12303 if (cur->type != XML_ELEMENT_NODE)
12306 switch (cur->type) {
12308 if (xmlStrEqual(name, cur->name)) {
12310 if (cur->ns == NULL)
12315 if ((cur->ns != NULL) &&
12316 (xmlStrEqual(URI, cur->ns->href)))
12324 xmlAttrPtr attr = (xmlAttrPtr) cur;
12345 if (cur->type == XML_NAMESPACE_DECL) {
12346 xmlNsPtr ns = (xmlNsPtr) cur;
12360 } while (cur != NULL);
12555 int total = 0, cur;
12587 cur =
12602 if (total > cur)
12604 return (total + cur);
12679 int total = 0, cur;
12718 cur =
12737 if (total > cur)
12739 return (total + cur);
14066 xmlNodePtr cur = NULL, limit = NULL;
14118 cur = (xmlNodePtr)ctxt->doc;
14128 cur = ctxt->node;
14148 limit = cur;
14150 if (cur == NULL) {
14170 xmlXPathNodeSetAddUnique((*resultSeq)->nodesetval, cur);
14179 switch (cur->type) {
14185 if (cur->type == XML_ELEMENT_NODE) {
14186 ret = xmlStreamPush(patstream, cur->name,
14187 (cur->ns ? cur->ns->href : NULL));
14189 ret = xmlStreamPushNode(patstream, NULL, NULL, cur->type);
14198 xmlXPathNodeSetAddUnique((*resultSeq)->nodesetval, cur);
14200 if ((cur->children == NULL) || (depth >= max_depth)) {
14202 while (cur->next != NULL) {
14203 cur = cur->next;
14204 if ((cur->type != XML_ENTITY_DECL) &&
14205 (cur->type != XML_DTD_NODE))
14214 if ((cur->children != NULL) && (depth < max_depth)) {
14218 if (cur->children->type != XML_ENTITY_DECL) {
14219 cur = cur->children;
14224 if (cur->type != XML_DTD_NODE)
14229 if (cur == limit)
14232 while (cur->next != NULL) {
14233 cur = cur->next;
14234 if ((cur->type != XML_ENTITY_DECL) &&
14235 (cur->type != XML_DTD_NODE))
14240 cur = cur->parent;
14242 if ((cur == NULL) || (cur == limit))
14244 if (cur->type == XML_ELEMENT_NODE) {
14247 ((cur->type == XML_TEXT_NODE) ||
14248 (cur->type == XML_CDATA_SECTION_NODE) ||
14249 (cur->type == XML_COMMENT_NODE) ||
14250 (cur->type == XML_PI_NODE)))
14254 if (cur->next != NULL) {
14255 cur = cur->next;
14258 } while (cur != NULL);
14260 } while ((cur != NULL) && (depth >= 0));
14620 if (*pctxt->cur != 0) {
14817 if (ctxt->cur != NULL)
14818 while (*ctxt->cur != 0) ctxt->cur++;
14870 } else if ((*ctxt->cur != 0) && (ctxt->comp != NULL)
14928 if ((*pctxt->cur != 0) || (pctxt->error != XPATH_EXPRESSION_OK)) {