Re: [xml] relative xpath matches nodes anywhere in tree



On Fri, May 25, 2012 at 4:44 AM, Daniel Veillard <veillard redhat com> wrote:
ÂActually the error is in --xpath implementation in xmllint :-)

static void doXPathQuery(
 ...
 Âctxt->node = xmlDocGetRootElement(doc);
 Âres = xmlXPathEval(BAD_CAST query, ctxt);

Âhere the initialization is done with the Root element instead of
doc itself which is the classic initialization of the context node when
none is specified, leading to the error,

Ah, in that case it would be helpful if the documentation mentioned
the correct way to initialize. Using the doc to indicate that the
context is Root seems surprising to me.

PS this came up because of an XMLStarlet bug report:
http://sourceforge.net/tracker/index.php?func=detail&aid=3527850&group_id=66612&atid=515106

ÂI think that's unrelated :-)

Actually it is related, because XMLStarlet has the exact same bug as xmllint.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]