From 22bd156ff0b6727c1f5fb6069690f7e2a4cabcac Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 25 Jan 2007 11:53:52 +0000 Subject: Various fixes in the logic of XML functions: - Add new SQL command SET XML OPTION (also available via regular GUC) to control the DOCUMENT vs. CONTENT option in implicit parsing and serialization operations. - Subtle corrections in the handling of the standalone property in xmlroot(). - Allow xmlroot() to work on content fragments. - Subtle corrections in the handling of the version property in xmlconcat(). - Code refactoring for producing XML declarations. --- doc/src/sgml/config.sgml | 34 +++++++++++++++++++++++++++++++++- doc/src/sgml/datatype.sgml | 20 +++++++++++++++++++- 2 files changed, 52 insertions(+), 2 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 94fc8fd79aa..2a95d8fae73 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -1,4 +1,4 @@ - + Server Configuration @@ -3558,6 +3558,38 @@ SELECT * FROM parent WHERE key = 2400; + + xmloption (string) + + xmloption configuration parameter + + + SET XML OPTION + + + XML option + + + + Sets whether DOCUMENT or + CONTENT is implicit when converting between + XML and character string values. See for a description of this. Valid + values are DOCUMENT and + CONTENT. The default is + CONTENT. + + + + According to the SQL standard, the command to set this option is + +SET XML OPTION { DOCUMENT | CONTENT }; + + This syntax is also available in PostgreSQL. + + + + diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 47c2e5c74af..f0ba6c32c71 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1,4 +1,4 @@ - + Data Types @@ -3474,6 +3474,24 @@ XMLSERIALIZE ( { DOCUMENT | CONTENT } value AS + + When character string values are cast to or from type + xml without going through XMLPARSE or + XMLSERIALIZE, respectively, the choice of + DOCUMENT versus CONTENT is + determined by the XML option session configuration + parameter, which can be set using the standard command + +SET XML OPTION { DOCUMENT | CONTENT }; + + or the more PostgreSQL-like syntax + +SET xmloption TO { DOCUMENT | CONTENT }; + + The default is CONTENT, so all forms of XML + data are allowed. + + Care must be taken when dealing with multiple character encodings on the client, server, and in the XML data passed through them. -- cgit v1.2.3