From 73c1748d833617c6ba19750236f8e09beedb132a Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Thu, 13 Apr 2017 12:08:34 -0300 Subject: [PATCH] Fix XMLTABLE synopsis, add XMLNAMESPACES example MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Add a missing comma in the synopsis after the XMLNAMESPACES clause. Also, add an example illustrating the use of that clause. Author: Arjen Nienhuis and Pavel Stěhule --- doc/src/sgml/func.sgml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index adab3030c4..f06d0a92c0 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -10525,7 +10525,7 @@ SELECT xpath_exists('/my:a/text()', 'test -xmltable( XMLNAMESPACES(namespace uri AS namespace name, ...) +xmltable( XMLNAMESPACES(namespace uri AS namespace name, ...), row_expression PASSING BY REF document_expression BY REF COLUMNS name { type PATH column_expression DEFAULT default_expression NOT NULL | NULL | FOR ORDINALITY } @@ -10708,6 +10708,36 @@ SELECT xmltable.* element ---------------------- Hello2a2 bbbCC +]]> + + + + The following example illustrates how + the XMLNAMESPACES clause can be used to specify + the default namespace, and a list of additional namespaces + used in the XML document as well as in the XPath expressions: + + + + + +'::xml) +) +SELECT xmltable.* + FROM XMLTABLE(XMLNAMESPACES('http://example.com/myns' AS x, + 'http://example.com/b' AS "B"), + '/x:example/x:item' + PASSING (SELECT data FROM xmldata) + COLUMNS foo int PATH '@foo', + bar int PATH '@B:bar'); + foo | bar +-----+----- + 1 | 2 + 3 | 4 + 4 | 5 +(3 rows) ]]> -- 2.40.0