Add XMLText function (SQL/XML X038)
Daniel Gustafsson <dgustafsson@postgresql.org>
Add XMLText function (SQL/XML X038) This function implements the standard XMLTest function, which converts text into xml text nodes. It uses the libxml2 function xmlEncodeSpecialChars to escape predefined entities (&"<>), so that those do not cause any conflict when concatenating the text node output with existing xml documents. This also adds a note in features.sgml about not supporting XML(SEQUENCE). The SQL specification defines a RETURNING clause to a set of XML functions, where RETURNING CONTENT or RETURNING SEQUENCE can be defined. Since PostgreSQL doesn't support XML(SEQUENCE) all of these functions operate with an implicit RETURNING CONTENT. Author: Jim Jones <jim.jones@uni-muenster.de> Reviewed-by: Vik Fearing <vik@postgresfriends.org> Discussion: https://postgr.es/m/86617a66-ec95-581f-8d54-08059cca8885@uni-muenster.de
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/features.sgml | modified | +9 −0 |
| doc/src/sgml/func.sgml | modified | +30 −0 |
| src/backend/catalog/sql_features.txt | modified | +1 −1 |
| src/backend/utils/adt/xml.c | modified | +22 −0 |
| src/include/catalog/pg_proc.dat | modified | +3 −0 |
| src/test/regress/expected/xml_1.out | modified | +23 −0 |
| src/test/regress/expected/xml_2.out | modified | +36 −0 |
| src/test/regress/expected/xml.out | modified | +36 −0 |
| src/test/regress/sql/xml.sql | modified | +7 −0 |
Documentation touched
Discussion
- [PATCH] Add XMLText function (SQL/XML X038) 24 messages · 2023-03-25 → 2023-11-06