Re: [xml] Newbie Help



I actually solved my problem.   None of the examples and tutorials mentioned using xmlXPathInit().  However, because I found a discussion somewhere about needing to call this function once in a multi-threaded application I included it in my code.  However, there was nothing (that I could find) that stated that the call had to be made outside of the "worker thread".  Since I only need to implement xml and xpath in this one thread, I was calling xmlXPathInit() in that thread.  Eventually, as a shot-in-the-dark, I moved it to the calling process, main(), and everything works now.  Perhaps I have just overlooked the documentation which details this behavior.

On Fri, 2004-08-13 at 15:30, Stefan Kost wrote:
Hi Bryan,

do you use namespaces in your xml file. If so, that one needs to be registered
first, before doing queries. In the future it is helpful to add a snipped of the
XML files as well, when asking.

Stefan

Bryan Christ wrote:
> Well that helps a bit, but the problem still remains that the list
> shouldn't return empty.  Any thoughts?
> 
> On Mon, 2004-08-09 at 16:14, Daniel Veillard wrote:
> 
> 
>>On Mon, Aug 09, 2004 at 03:44:47PM -0500, Bryan Christ wrote:
>>
>>>Supplying the leading / is one of the permutations of the _expression_
>>>that I have already tried.  When I do this, I *do not* get the error
>>>messages:
>>>
>>>xmlXPathNodeCollectAndTest xpath.c:1923 : nodelist and node are NULL
>>>
>>>However, xpath_object is still returned as NULL.  According to the
>>>documentation, even if there are no matches, shouldn't I receive back a
>>>valid pointer to an empty list?
>>
>>  No, you may get NULL for an empty Nodeset. It's an optimization 
>>which made huge difference for XSLT performances (no need to allocate/
>>deallocate empty lists all the time).
>>
>>Daniel
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> xml mailing list, project page  http://xmlsoft.org/
> xml gnome org
> http://mail.gnome.org/mailman/listinfo/xml


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]