BUG #16046: xpath returns CDATA tag along with the value in postgres 12

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

BUG #16046: xpath returns CDATA tag along with the value in postgres 12

PG Bug reporting form
The following bug has been logged on the website:

Bug reference:      16046
Logged by:          Mohammad Mostafa Kamal
Email address:      [hidden email]
PostgreSQL version: 12.0
Operating system:   Windows 7
Description:        

While using xpath to extract text from a CDATA section of xml, it returns
CDATA tag along with the value.

Query: SELECT
unnest(xpath('//cname/aname/text()','<cname><aname><![CDATA[select
5]]></aname></cname>'::xml))

Output - pg11: select 5

Output - pg12:  <![CDATA[select 5]]>