1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-27 12:15:34 +03:00

Fix xmllint --xpath node initialization

By default it's more sensible to initialize it to the document itself
than the root element
This commit is contained in:
Daniel Veillard
2012-05-25 16:44:20 +08:00
parent c943f708f1
commit 2e1eaca637

View File

@@ -2139,7 +2139,7 @@ static void doXPathQuery(xmlDocPtr doc, const char *query) {
progresult = XMLLINT_ERR_MEM; progresult = XMLLINT_ERR_MEM;
return; return;
} }
ctxt->node = xmlDocGetRootElement(doc); ctxt->node = (xmlNodePtr) doc;
res = xmlXPathEval(BAD_CAST query, ctxt); res = xmlXPathEval(BAD_CAST query, ctxt);
xmlXPathFreeContext(ctxt); xmlXPathFreeContext(ctxt);