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