Re: BUG #14151: Xml special symbols are not unescaped when gettting value of Xml via xpath - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #14151: Xml special symbols are not unescaped when gettting value of Xml via xpath
Date
Msg-id 32376.1463680578@sss.pgh.pa.us
Whole thread Raw
In response to BUG #14151: Xml special symbols are not unescaped when gettting value of Xml via xpath  (onic@live.fr)
Responses Re: BUG #14151: Xml special symbols are not unescaped when gettting value of Xml via xpath
List pgsql-bugs
onic@live.fr writes:
> SELECT unnest(xpath('/name/text()', xmlelement(name name, 'AT&T', null )))
> This gives me 'AT&T' and

AFAICS, that behavior is correct.  xpath returns a value of type xml
(well, really xml[]) and 'AT&T' is not a legal value of that type;
only 'AT&T' is.

> I have NO WAY inside pgsql to get 'At&t' value

I agree that there ought to be an "unescape" function that would convert
this back to 'AT&T', but the lack of one seems like a missing feature not
a bug.  I'd wonder for example what an unescape function ought to do with
other markup such as '<name>'.

The last concrete discussion we had on this seems to have been
this thread:

http://www.postgresql.org/message-id/flat/C71079E6-12D8-4048-B8C5-18368936FD5D@phlo.org

which petered out for lack of anyone finding the time to investigate
the relevant standards.

            regards, tom lane

pgsql-bugs by date:

Previous
From: onic@live.fr
Date:
Subject: BUG #14151: Xml special symbols are not unescaped when gettting value of Xml via xpath
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #14151: Xml special symbols are not unescaped when gettting value of Xml via xpath