Re: xpath processing brain dead

Поиск
Список
Период
Сортировка
От James Pye
Тема Re: xpath processing brain dead
Дата
Msg-id 52E6D713-48A4-4EC0-8FF1-81B44C797CEF@jwp.name
обсуждение исходный текст
Ответ на Re: xpath processing brain dead  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: xpath processing brain dead
Список pgsql-hackers
On Feb 26, 2009, at 7:03 PM, Andrew Dunstan wrote:
> can you point me at any call in libxml2 which will evaluate an xpath  
> expression in the context of a nodeset instead of a document?

No, I can't. node-sets are XPath objects not xmlNode objects, so I  
don't think it would be as simple as modifying:

xml.c:xpath() {   ...   xpathctx->node = xmlDocGetRootElement(doc);

with the result of xmlXPathNewNodeSet..

[snip other questions]

My *guess* would be that if we were to use a node-set instead, we'd  
still have to prefix the XPath query. In this case, with a function  
call to an xpath extension function that creates the NodeSet from the  
content fragment(s?) of the document created by xml_parse(ie, more or  
less, a re-implementation of exsl:node-set() tailored for our use- 
case). Well, that or force the user to call it explicitly. Possible or  
not--wrt using a content fragment/document as the context node, I find  
this less desirable than the current mangling, so I'm becoming quite  
indifferent. :)


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: add_path optimization
Следующее
От: Tom Lane
Дата:
Сообщение: Re: add_path optimization