--- parser3/src/classes/xnode.C 2002/01/24 13:26:01 1.30 +++ 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.30 2002/01/24 13:26:01 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())); @@ -425,12 +425,12 @@ static void selectNodesHandler(Pool& poo const String& expression, xmlXPathObject_auto_ptr res, Value *& result) { + VHash *vhash=new(pool) VHash(pool); result=vhash; switch(res->type) { case XPATH_UNDEFINED: break; case XPATH_NODESET: if(int size=res->nodesetval->nodeNr) { - VHash *vhash=new(pool) VHash(pool); Hash& hash=vhash->hash(0); for(int i=0; inodesetval->nodeTab[i]))); } - result=vhash; } break; default: