Re: xpath processing brain dead

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Cc: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>, Simon Riggs <simon(at)2ndQuadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>
Subject: Re: xpath processing brain dead
Date: 2009-03-20 15:56:29
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan wrote:
> Hannu Krosing wrote:
>> Is it just that in you _can't_ use Xpath on fragments, and you _need_ to
>> pass full documents to Xpath ?
>> At least this is my reading of Xpath standard.
> I think that's possibly overstating it., unless I have missed
> something (W3 standards are sometimes not much more clear than the SQL
> standards ;-( )
> For instance, there's this, that implies at least that the tree might
> not be a document:
> A "/" at the beginning of a path expression is an abbreviation for
> the initial step fn:root(self::node()) treat as document-node()/
> (however, if the "/" is the entire path expression, the trailing "/"
> is omitted from the expansion.) The effect of this initial step is
> to begin the path at the root node of the tree that contains the
> context node. If the context item is not a node, a type error is
> raised [err:XPTY0020]. At evaluation time, if the root node above
> the context node is not a document node, a dynamic error is raised
> [err:XPDY0050].
> The problem is that we certainly do have to provide a context node
> (the standard is clear about that), and unless we want to convert a
> non-document to a node-set as James suggested and then apply the xpath
> expression to each node in the node-set, we have no way of sanely
> specifying the context node.

No-one has come up with an answer to this, so I propose to remove the
hackery. That leaves the question of what to do when the xml is not a
well formed document ... raise an error?



In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-03-20 16:53:08 Re: small but useful patches for text search
Previous Message Tom Lane 2009-03-20 15:42:46 Re: small but useful patches for text search