pgsql: Fix namespace handling in xpath function

Lists: pgsql-committers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix namespace handling in xpath function
Date: 2015-01-18 03:43:14
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-committers

Fix namespace handling in xpath function

Previously, the xml value resulting from an xpath query would not have
namespace declarations if the namespace declarations were attached to
an ancestor element in the input xml value. That means the output value
was not correct XML. Fix that by running the result value through
xmlCopyNode(), which produces the correct namespace declarations.

Author: Ali Akbar <the(dot)apaan(at)gmail(dot)com>

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/c8ef5b1aceb0fec2b928778e83371b13ba7d70e1

Modified Files
--------------
src/backend/utils/adt/xml.c | 34 ++++++++++++++++++++++++++--------
src/test/regress/expected/xml.out | 15 +++++++++++++++
src/test/regress/expected/xml_1.out | 12 ++++++++++++
src/test/regress/sql/xml.sql | 2 ++
4 files changed, 55 insertions(+), 8 deletions(-)