Commit c4f4f0b7 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

- xpath.c: fixed the root evaluation problems

- HTMLparser.c result/HTML/doc3.htm: fixed the problem of non
  ignorable spaces with <b> <bold> <em>
- tree.c: fixed a loop in xmlSearchNsByHref()
Daniel
parent 767662db
Sun Oct 29 18:38:12 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* xpath.c: fixed the root evaluation problems
* HTMLparser.c result/HTML/doc3.htm: fixed the problem of non
ignorable spaces with <b> <bold> <em>
* tree.c: fixed a loop in xmlSearchNsByHref()
Fri Oct 27 18:57:32 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* xpath.c: applied another XPath patch from TOM
......
......@@ -1712,8 +1712,15 @@ static int areBlanks(htmlParserCtxtPtr ctxt, const xmlChar *str, int len) {
lastChild = xmlGetLastChild(ctxt->node);
if (lastChild == NULL) {
if (ctxt->node->content != NULL) return(0);
} else if (xmlNodeIsText(lastChild))
} else if (xmlNodeIsText(lastChild)) {
return(0);
} else if (xmlStrEqual(lastChild->name, BAD_CAST"b")) {
return(0);
} else if (xmlStrEqual(lastChild->name, BAD_CAST"bold")) {
return(0);
} else if (xmlStrEqual(lastChild->name, BAD_CAST"em")) {
return(0);
}
return(1);
}
......
......@@ -174,8 +174,8 @@ eval("page" + id + " = window.open(URL, '" + id + "', 'toolbars=0, scrollbars=0,
<br>
</font></a>
<br>
<b><font color="yellow" face="Verdana" size="2">Pic of the day</font></b>
<hr>
<b><font color="yellow" face="Verdana" size="2">Pic of the day</font></b>
<hr>
<center><p align="center"><font face="Verdana, Arial, Helvetica" size="1"><a href="http://bp6.gamesquad.net/cgi-bin/schlabo/potd.pl"><img alt="No picture is available for today." border="0" src="doc3_files/potd_na_110x83.gif"></a></font></p></center>
<br>
<center></center>
......
......@@ -3569,6 +3569,7 @@ xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar *href) {
goto shadowed;
tst = tst->next;
}
check = check->parent;
}
return(cur);
}
......
......@@ -2610,13 +2610,6 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, xmlXPathAxisVal axis,
*/
void
xmlXPathRoot(xmlXPathParserContextPtr ctxt) {
if (ctxt->value != NULL) {
xmlXPathObjectPtr obj;
CHECK_TYPE(XPATH_NODESET);
obj = valuePop(ctxt);
xmlXPathFreeObject(obj);
}
ctxt->context->node = (xmlNodePtr) ctxt->context->doc;
valuePush(ctxt, xmlXPathNewNodeSet(ctxt->context->node));
}
......@@ -4365,6 +4358,8 @@ xmlXPathEvalPathExpr(xmlXPathParserContextPtr ctxt) {
}
if (lc) {
if (CUR == '/')
xmlXPathRoot(ctxt);
xmlXPathEvalLocationPath(ctxt);
} else {
xmlXPathEvalFilterExpr(ctxt);
......@@ -5261,7 +5256,6 @@ xmlXPathEvalLocationPath(xmlXPathParserContextPtr ctxt) {
} else if (CUR == '/') {
NEXT;
SKIP_BLANKS;
xmlXPathRoot(ctxt);
if (CUR != 0)
xmlXPathEvalRelativeLocationPath(ctxt);
}
......@@ -5283,7 +5277,6 @@ xmlXPathObjectPtr
xmlXPathEval(const xmlChar *str, xmlXPathContextPtr ctx) {
xmlXPathParserContextPtr ctxt;
xmlXPathObjectPtr res = NULL, tmp;
xmlXPathObjectPtr init = NULL;
int stack = 0;
xmlXPathInit();
......@@ -5291,12 +5284,6 @@ xmlXPathEval(const xmlChar *str, xmlXPathContextPtr ctx) {
CHECK_CONTEXT(ctx)
ctxt = xmlXPathNewParserContext(str, ctx);
if (ctx->node != NULL) {
init = xmlXPathNewNodeSet(ctx->node);
valuePush(ctxt, init);
}
if (str[0] == '/')
xmlXPathRoot(ctxt);
xmlXPathEvalExpr(ctxt);
if (ctxt->value == NULL) {
......@@ -5310,8 +5297,7 @@ xmlXPathEval(const xmlChar *str, xmlXPathContextPtr ctx) {
tmp = valuePop(ctxt);
if (tmp != NULL) {
xmlXPathFreeObject(tmp);
if (tmp != init)
stack++;
stack++;
}
} while (tmp != NULL);
if (stack != 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment