Re: xpath processing brain dead - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: xpath processing brain dead
Date
Msg-id 49A74A03.6060508@dunslane.net
Whole thread Raw
In response to Re: xpath processing brain dead  (James Pye <lists@jwp.name>)
Responses Re: xpath processing brain dead  (James Pye <lists@jwp.name>)
Re: xpath processing brain dead  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers

James Pye wrote:
> On Feb 26, 2009, at 5:41 PM, Andrew Dunstan wrote:
>>> http://www.exslt.org/exsl/functions/node-set/index.html
>>
>> A node-set isn't a document.
>
> yes.. :)
>
> I guess what I'm saying is that if:
>
> tinman=# SELECT XML'<foo/><bar/>';
>      xml
> --------------
>  <foo/><bar/>
> (1 row)
>
> is considered to be valid per *SQL-XML*, then it should probably be 
> treated as a node-set in the context of xpath, not mangled with 
> <x>...</x>..
>
> Certainly, I would expect an implicit "node-set() call" long before 
> wrapping the fragment in <x>...</x> and prefixing my xpath query.
>
> However, I find the validity of the above, XML'<foo/><bar/>', a bit 
> disturbing to begin with. :P
>
>> In any case, this functionality doesn't appear to be in libxml2,
>> it's in libxslt according to the reference you provided.
>
> I think that's *just* referencing the list of xslt implementations 
> that the extension function is known to be available in.. I doubt that 
> means to imply that the function or equivalent functionality is not 
> available in libxml2 itself. I'd wager that equivalent functionality 
> could be implemented if it weren't directly/already available.. =)
>

James,

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? Quite 
apart from anything else, xpath requires there to be a (single) context 
node (see http://www.w3.org/TR/xpath20/#context ). For a doc, we set 
that node to the document node, but what would it be for a node-set or a 
fragment? If we can't get over that hurdle we're screwed in pursuing 
your line of thought.

cheers

andrew


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Any reason for no pg_get_operatordef?
Next
From: Andrew Dunstan
Date:
Subject: Re: xpath processing brain dead