mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-10 08:58:16 +03:00
- xpath.c: seems I finally killed that ugly path evaluation
context bug (tagged 9999 in case is is wrong) Daniel
This commit is contained in:
parent
8f4d97579a
commit
5a2b697af8
@ -1,3 +1,8 @@
|
||||
Fri Jan 19 18:15:50 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||
|
||||
* xpath.c: seems I finally killed that ugly path evaluation
|
||||
context bug (tagged 9999 in case is is wrong)
|
||||
|
||||
Fri Jan 19 06:30:38 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||
|
||||
* xpath.[ch] xpathInternals.h: added xmlXPathRegisterVariableLookup()
|
||||
|
@ -570,6 +570,10 @@ xmlChar * xmlGetProp (xmlNodePtr node,
|
||||
const xmlChar *name);
|
||||
xmlAttrPtr xmlHasProp (xmlNodePtr node,
|
||||
const xmlChar *name);
|
||||
xmlAttrPtr xmlSetNsProp (xmlNodePtr node,
|
||||
xmlNsPtr ns,
|
||||
const xmlChar *name,
|
||||
const xmlChar *value);
|
||||
xmlChar * xmlGetNsProp (xmlNodePtr node,
|
||||
const xmlChar *name,
|
||||
const xmlChar *nameSpace);
|
||||
|
4
tree.h
4
tree.h
@ -570,6 +570,10 @@ xmlChar * xmlGetProp (xmlNodePtr node,
|
||||
const xmlChar *name);
|
||||
xmlAttrPtr xmlHasProp (xmlNodePtr node,
|
||||
const xmlChar *name);
|
||||
xmlAttrPtr xmlSetNsProp (xmlNodePtr node,
|
||||
xmlNsPtr ns,
|
||||
const xmlChar *name,
|
||||
const xmlChar *value);
|
||||
xmlChar * xmlGetNsProp (xmlNodePtr node,
|
||||
const xmlChar *name,
|
||||
const xmlChar *nameSpace);
|
||||
|
11
xpath.c
11
xpath.c
@ -1241,7 +1241,10 @@ xmlXPathNewString(const xmlChar *val) {
|
||||
}
|
||||
memset(ret, 0 , (size_t) sizeof(xmlXPathObject));
|
||||
ret->type = XPATH_STRING;
|
||||
if (val != NULL)
|
||||
ret->stringval = xmlStrdup(val);
|
||||
else
|
||||
ret->stringval = xmlStrdup((const xmlChar *)"");
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@ -3481,6 +3484,7 @@ xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
int i = 0; /* Should be first in document order !!!!! */
|
||||
res = xmlNodeGetContent(cur->nodesetval->nodeTab[i]);
|
||||
valuePush(ctxt, xmlXPathNewString(res));
|
||||
if (res != NULL)
|
||||
xmlFree(res);
|
||||
}
|
||||
xmlXPathFreeObject(cur);
|
||||
@ -4560,6 +4564,7 @@ xmlXPathEvalVariableReference(xmlXPathParserContextPtr ctxt) {
|
||||
if (CUR != '$') {
|
||||
XP_ERROR(XPATH_VARIABLE_REF_ERROR);
|
||||
}
|
||||
NEXT;
|
||||
name = xmlXPathParseQName(ctxt, &prefix);
|
||||
if (name == NULL) {
|
||||
XP_ERROR(XPATH_VARIABLE_REF_ERROR);
|
||||
@ -4922,6 +4927,10 @@ xmlXPathEvalPathExpr(xmlXPathParserContextPtr ctxt) {
|
||||
if (lc) {
|
||||
if (CUR == '/')
|
||||
xmlXPathRoot(ctxt);
|
||||
else {
|
||||
/* TAG:9999 */
|
||||
valuePush(ctxt, xmlXPathNewNodeSet(ctxt->context->node));
|
||||
}
|
||||
xmlXPathEvalLocationPath(ctxt);
|
||||
} else {
|
||||
xmlXPathEvalFilterExpr(ctxt);
|
||||
@ -5869,10 +5878,12 @@ xmlXPathEval(const xmlChar *str, xmlXPathContextPtr ctx) {
|
||||
CHECK_CONTEXT(ctx)
|
||||
|
||||
ctxt = xmlXPathNewParserContext(str, ctx);
|
||||
/**** TAG:9999
|
||||
if (ctx->node != NULL) {
|
||||
init = xmlXPathNewNodeSet(ctx->node);
|
||||
valuePush(ctxt, init);
|
||||
}
|
||||
****/
|
||||
xmlXPathEvalExpr(ctxt);
|
||||
|
||||
if (ctxt->value == NULL) {
|
||||
|
@ -1337,10 +1337,12 @@ xmlXPtrEval(const xmlChar *str, xmlXPathContextPtr ctx) {
|
||||
return(NULL);
|
||||
|
||||
ctxt = xmlXPathNewParserContext(str, ctx);
|
||||
/* TAG:9999
|
||||
if (ctx->node != NULL) {
|
||||
init = xmlXPathNewNodeSet(ctx->node);
|
||||
valuePush(ctxt, init);
|
||||
}
|
||||
*/
|
||||
xmlXPtrEvalXPointer(ctxt);
|
||||
|
||||
if ((ctxt->value != NULL) &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user