From 2e1eaca637ae1f07c5c71829e94012e27a86d88c Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Fri, 25 May 2012 16:44:20 +0800 Subject: [PATCH] Fix xmllint --xpath node initialization By default it's more sensible to initialize it to the document itself than the root element --- xmllint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmllint.c b/xmllint.c index 40a21946..3edeccb1 100644 --- a/xmllint.c +++ b/xmllint.c @@ -2139,7 +2139,7 @@ static void doXPathQuery(xmlDocPtr doc, const char *query) { progresult = XMLLINT_ERR_MEM; return; } - ctxt->node = xmlDocGetRootElement(doc); + ctxt->node = (xmlNodePtr) doc; res = xmlXPathEval(BAD_CAST query, ctxt); xmlXPathFreeContext(ctxt);