pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: Garfield Lewis <garfield.lewis@lzlabs.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Using XMLNAMESPACES with XMLEMENT
Date: Fri, 24 Sep 2021 17:37:03 -0600
Message-ID: <B61D9694-83D3-4F09-8AED-A6A45A9F66FD@gmail.com> (raw)
In-Reply-To: <F0F3167D-1CE8-44D9-AA7F-F102EB683EA0@lzlabs.com>
References: <F0F3167D-1CE8-44D9-AA7F-F102EB683EA0@lzlabs.com>



> On Sep 24, 2021, at 4:54 PM, Garfield Lewis <garfield.lewis@lzlabs.com> wrote:
> 
> 
> I’m using PG v12.6 and no I haven’t tried the path function. Do you have an example?
>  
> -- 
> Regards,
> Garfield A. Lewis
>  
> From: Rob Sargent <robjsargent@gmail.com>
> Date: Friday, September 24, 2021 at 6:52 PM
> To: Garfield Lewis <garfield.lewis@lzlabs.com>
> Cc: "pgsql-general@postgresql.org" <pgsql-general@postgresql.org>
> Subject: Re: Using XMLNAMESPACES with XMLEMENT
>  
>  
> 
> 
> On Sep 24, 2021, at 3:44 PM, Garfield Lewis <garfield.lewis@lzlabs.com> wrote:
> 
> Hi All,
>  
> I am attempting to port the following statement from DB2z to Postgres:
>  
> SELECT e.empno, e.firstnme, e.lastname,
>           XMLELEMENT ( NAME "foo:Emp",
>             XMLNAMESPACES('http://www.foo.com'; AS "foo"),
>             XMLATTRIBUTES(e.empno as "serial"),
>                           e.firstnme,
>                           e.lastname ) AS "Result"
>        FROM EMP e
>        WHERE e.edlevel = 12;
>  
> The NAMESPACES function is not supported by Postgres in the XMLELEMENT function. Is there any way to get this to work? I’ve looked at the WITH syntax but it doesn’t look like that will be helpful here.
>  
>  
> Which Postgres version?  Have you tried path function?
> Regards,
> Garfield

https://www.postgresql.org/docs/12/functions-xml.html#FUNCTIONS-XML-PROCESSING=

view thread (7+ messages)  latest in thread

Message-ID: <B61D9694-83D3-4F09-8AED-A6A45A9F66FD@gmail.com>
Permalink:  ../B61D9694-83D3-4F09-8AED-A6A45A9F66FD@gmail.com/
Also on:    postgresql.org/message-id/B61D9694-83D3-4F09-8AED-A6A45A9F66FD@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: robjsargent@gmail.com, garfield.lewis@lzlabs.com
  Subject: Re: Using XMLNAMESPACES with XMLEMENT
  In-Reply-To: <B61D9694-83D3-4F09-8AED-A6A45A9F66FD@gmail.com>
  References: <F0F3167D-1CE8-44D9-AA7F-F102EB683EA0@lzlabs.com> <B61D9694-83D3-4F09-8AED-A6A45A9F66FD@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox