Skip site navigation (1) Skip section navigation (2)

xpath processing brain dead

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: xpath processing brain dead
Date: 2009-02-26 04:08:10
Message-ID: 49A615AA.90606@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-hackers
Andrew Gierth was just pointing out to me how badly broken our XPath 
processing is.

For fear of passing an ill formed fragment of xml to the processor, we 
strip the xml declaration if any and surround what's left with '<x>" and 
'</x>' and prepend '/x' to the supposed xpath. This is just horrible. It 
will break for every xpath expression that doesn't begin with a '/' and 
probably for many that do.

This whole thing is a mess, and I suspect the only fix for now is to 
undo all the mangling of both the xml and the xpath expression. If the 
programmer passes an ill formed piece of xml to the processor that is 
their lookout, but I think we should ensure that we give back correct 
results on well formed input.

The only good piece of news is that the xpath procedures in contrib/xml2 
don't apparently suffer these faults.

cheers

andrew

Responses

pgsql-hackers by date

Next:From: Joshua D. DrakeDate: 2009-02-26 04:09:58
Subject: Re: 8.4 release planning (was Re: [COMMITTERS] pgsql: Automatic view update rules)
Previous:From: KaiGai KoheiDate: 2009-02-26 04:04:40
Subject: Updates of SE-PostgreSQL 8.4devel patches (r1627)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group