XPATH evaluation

From: Radosław Smogura <rsmogura(at)softperience(dot)eu>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: XPATH evaluation
Date: 2011-06-17 09:09:39
Message-ID: f64d8629aea32338b688bc8cd58ae566@mail.softperience.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

During review of
https://commitfest.postgresql.org/action/patch_view?id=580 I found
following problems with XPath.

1.
SELECT (XPATH('/root/*', '<root xmlns:o="http://olacle.com/db"
xmlns:p="http://postgresql.org/db"><o:db><a><b></b></a></o:db><p:db></p:db></root>'));
Produces:
"{"<o:db>
<a>
<b/>
</a>
</o:db>",<p:db/>}"
In above <b></b> was reduced to <b/> this is different infoset then
input, and those notations are differently interpreted e.g. by XML
Binding & WebServices. The 1st one will may be mapped to empty string,
and 2nd one to to null.

As well result was formatted which produces again different infoset.

Both of above may cause problems with XML digesting.

2.
SELECT (XPATH('/root/*', '<root xmlns:o="http://olacle.com/db"
xmlns:p="http://postgresql.org/db"><o:db></o:db><p:db></p:db></root>'));
"{<o:db/>,<p:db/>}"
In above I missing namespaces.

I may take on assignment 1st (fix is simple), but for 2nd I have mixed
fillings. I think 2nd should transfer namespaces in some way to client.

What do You think?

Regards,
Radosław Smogura

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian Pflug 2011-06-17 09:41:08 Re: XPATH evaluation
Previous Message Cédric Villemain 2011-06-17 08:57:53 Re: Re: patch review : Add ability to constrain backend temporary file space