XMLDocument (SQL/XML X030)

From: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: XMLDocument (SQL/XML X030)
Date: 2024-12-04 16:18:54
Message-ID: d22cfe49-1567-4848-b7b7-9e1fe75f8828@uni-muenster.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I'd like to propose the implementation of XMLDocument (SQL/XML X030).It
basically returns an XML document from a given XML expression, e.g.

SELECT
  xmldocument(
    xmlelement(NAME foo,
      xmlattributes(42 AS att),
      xmlelement(NAME bar,
        xmlconcat('va', 'lue'))
    )
  );

             xmldocument
--------------------------------------
 <foo att="42"><bar>value</bar></foo>
(1 row)

XMLDocument doesn't do much. In fact, it might be reduced to a simple
xmlparse() call as XMLOPTION_DOCUMENT...

xmlparse(data, XMLOPTION_DOCUMENT, true)

... to make sure that the given XML expression is a valid document -
still need some more research there. One could argue that XMLDocument()
is in most cases unnecessary, but I believe it would facilitate the
migration of scripts from other database products.

Any thoughts?

Best, Jim

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-12-04 16:35:58 Re: Remove remnants of "snapshot too old"
Previous Message Paul Jungwirth 2024-12-04 16:16:27 Re: SQL:2011 application time