xmloption
A configuration parameter determining how to convert between XML and normal strings
xmloption
is a configuration parameter determining whether DOCUMENT
or CONTENT
is implicit when converting between XML
and character string values.
xmloption
was added in PostgreSQL 8.3.
Usage
xmloption
can be set to one of the following values to determine how XML strings are parsed:
CONTENT
- to process well-formed XML snippetsDOCUMENT
- to process well-formed XML documents
xmloption
can also be set with the following SQL-standard compliant command:
SET XML OPTION { DOCUMENT | CONTENT }
Default value
The default value for xmloption
is: CONTENT
.
Change history
- PostgreSQL 8.3
- added (commit 8c1de5fb)
Examples
Simple demonstration of xmloption
settings:
postgres=# SHOW xmloption; xmloption ----------- content (1 row) postgres=# SELECT '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT; ?column? ---------- f (1 row) postgres=# SET xmloption TO document; SET postgres=# SELECT '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT; ERROR: invalid XML document LINE 1: SELECT '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT; ^ DETAIL: line 1: Extra content at the end of the document <foo>bar</foo><bar>foo</bar> ^
References
- PostgreSQL documentation: xmloption
Categories
See also
xmlbinary