Fix namespace handling in xpath function
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 7 Jan 2015 04:06:13 +0000 (23:06 -0500)
committerPeter Eisentraut <peter_e@gmx.net>
Sun, 18 Jan 2015 03:13:27 +0000 (22:13 -0500)
commite32cb8d0e02f8f3fa2c66d80b5cf0ad762c79c9d
tree2db2c9f692bfc1010b960e5bfe2832a05a7bb685
parent1619442a1f592a1ea3988f3f74ffd14880962e0e
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.apaan@gmail.com>
src/backend/utils/adt/xml.c
src/test/regress/expected/xml.out
src/test/regress/expected/xml_1.out
src/test/regress/sql/xml.sql