--- parser3/src/classes/xnode.C 2002/01/24 13:57:19 1.31 +++ parser3/src/classes/xnode.C 2002/01/24 14:10:08 1.32 @@ -4,7 +4,7 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://paf.design.ru) - $Id: xnode.C,v 1.31 2002/01/24 13:57:19 paf Exp $ + $Id: xnode.C,v 1.32 2002/01/24 14:10:08 paf Exp $ */ #include "classes.h" #ifdef XML @@ -396,11 +396,11 @@ static void _selectX(Request& r, const S GdomeException exc; GdomeNode *dome_node=vnode.get_node(&method_name); GdomeDocument *dome_document=gdome_n_ownerDocument(dome_node, &exc); - if(!dome_document) - dome_document=GDOME_DOC(dome_node); + if(!dome_document) // document does not own itself, so ownerDocument = 0 + dome_document=GDOME_DOC(dome_node); // and we need downcast xmlDoc *xml_document=((_Gdome_xml_Document *)dome_document)->n; xmlXPathContext_auto_ptr ctxt(xmlXPathNewContext(xml_document)); - ctxt->node=xmlDocGetRootElement(xml_document); + ctxt->node=gdome_xml_n_get_xmlNode(dome_node); /*error to stderr for now*/ xmlXPathObject_auto_ptr res( xmlXPathEvalExpression(BAD_CAST pool.transcode(expression)->str, ctxt.get()));