From e6a7416e28bacef6311be20375c8498b23faeb65 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sat, 3 Jul 2010 17:21:48 +0000 Subject: [PATCH] Document more clearly on XML namespaces inside xpath function Nikolay Samokhvalov --- doc/src/sgml/func.sgml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index fd28615ae0..659da49a84 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,4 +1,4 @@ - + Functions and Operators @@ -8610,8 +8610,11 @@ SELECT xmlagg(x) FROM (SELECT * FROM test ORDER BY y DESC) AS tab; mappings. This array should be a two-dimensional array with the length of the second axis being equal to 2 (i.e., it should be an array of arrays, each of which consists of exactly 2 elements). - The first element of each array entry is the namespace name, the - second the namespace URI. + The first element of each array entry is the namespace name (alias), the + second the namespace URI. It is not required that aliases provided in + this array are the same that those being used in the XML document itself (in + other words, both in the XML document and in the xpath + function context, aliases are local). @@ -8624,6 +8627,19 @@ SELECT xpath('/my:a/text()', 'test', -------- {test} (1 row) +]]> + + + + How to deal with default (anonymous) namespaces: +test', + ARRAY[ARRAY['mydefns', 'http://example.com']]); + + xpath +-------- + {test} +(1 row) ]]> -- 2.40.0