--- parser3/src/classes/xnode.C 2002/01/14 15:29:41 1.26 +++ parser3/src/classes/xnode.C 2002/01/24 13:26:01 1.30 @@ -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.26 2002/01/14 15:29:41 paf Exp $ + $Id: xnode.C,v 1.30 2002/01/24 13:26:01 paf Exp $ */ #include "classes.h" #ifdef XML @@ -18,8 +18,8 @@ extern "C" { #include "gdomecore/gdome-xml-node.h" -}; #include "gdomecore/gdome-xml-document.h" +}; #include "gdome.h" #include "libxml/xpath.h" @@ -27,8 +27,8 @@ extern "C" { class xmlXPathObject_auto_ptr { public: - explicit xmlXPathObject_auto_ptr(xmlXPathObject *_P = 0) - : _Owns(_P != 0), _Ptr(_P) {} + explicit xmlXPathObject_auto_ptr(xmlXPathObject *_APtr = 0) + : _Owns(_APtr != 0), _Ptr(_APtr) {} xmlXPathObject_auto_ptr(const xmlXPathObject_auto_ptr& _Y) : _Owns(_Y._Owns), _Ptr(_Y.release()) {} xmlXPathObject_auto_ptr& operator=(const xmlXPathObject_auto_ptr& _Y) @@ -60,8 +60,8 @@ private: class xmlXPathContext_auto_ptr { public: - explicit xmlXPathContext_auto_ptr(xmlXPathContext *_P = 0) - : _Owns(_P != 0), _Ptr(_P) {} + explicit xmlXPathContext_auto_ptr(xmlXPathContext *_APtr = 0) + : _Owns(_APtr != 0), _Ptr(_APtr) {} xmlXPathContext_auto_ptr(const xmlXPathContext_auto_ptr& _Y) : _Owns(_Y._Owns), _Ptr(_Y.release()) {} xmlXPathContext_auto_ptr& operator=(const xmlXPathContext_auto_ptr& _Y) @@ -405,6 +405,13 @@ static void _selectX(Request& r, const S xmlXPathObject_auto_ptr res( xmlXPathEvalExpression(BAD_CAST pool.transcode(expression)->str, ctxt.get())); + if(xmlHaveGenericErrors()) { + GdomeException exc=0; + throw Exception(0, 0, + &expression, + exc); + } + Value *result=0; if(res.get()) handler(pool, expression, res, result); @@ -434,7 +441,7 @@ static void selectNodesHandler(Pool& poo } hash.put(skey, new(pool) VXnode(pool, - gdome_xml_n_mkref(res->nodesetval->nodeTab[0]))); + gdome_xml_n_mkref(res->nodesetval->nodeTab[i]))); } result=vhash; }