Re: XMLDocument (SQL/XML X030) - Mailing list pgsql-hackers

From Jim Jones
Subject Re: XMLDocument (SQL/XML X030)
Date
Msg-id 513a85fd-56b4-4300-9200-cf75c84d1c2e@uni-muenster.de
Whole thread Raw
In response to Re: XMLDocument (SQL/XML X030)  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: XMLDocument (SQL/XML X030)
List pgsql-hackers
On 24.01.25 12:31, Pavel Stehule wrote:
> I don't know what it means - `function returns a document node` in the
> context of Postgres implementation of XML.
> I miss the information so it returns an input argument without
> changing anything, because in a system, where XML expression
> holds a complete string (not graph like some other systems), it just
> does nothing.
>
> If somebody looks the source code, then he should be in panic mode,
> because the doc talks about returning "document node",
> and it is just an argument. So it should be explained more in
> PostgreSQL XML design, and less in SQL/XML description. Because
> In this case, SQL/XML description (in postgresql context) is
> absolutely confusing.


I see. I borrowed document node from the XML standard.

Perhaps it is more palatable like this?


The <function>xmldocument</function> function creates an XML value from
the given <type>xml</type> expression. The input can include any valid
XML content, such as elements, text, or a mixture of elements and text.
If the <type>xml</type> expression is NULL, the function returns NULL.
This function does not require the input to have a single root element
and does not wrap the result in one - instead, it returns an exact XML
representation of the input <type>xml</type> expression. The validation
of the <type>xml</type> expression depends on the current <xref
linkend="guc-xmloption"/> setting.


Best, Jim





pgsql-hackers by date:

Previous
From: Sergey Tatarintsev
Date:
Subject: Re: create subscription with (origin = none, copy_data = on)
Next
From: Peter Eisentraut
Date:
Subject: Re: Convert sepgsql tests to TAP