File tree Expand file tree Collapse file tree 5 files changed +25
-11
lines changed
Expand file tree Collapse file tree 5 files changed +25
-11
lines changed Original file line number Diff line number Diff line change @@ -21,17 +21,24 @@ you can place it in a different directory in a PostgreSQL tree).
2121Before you begin, just check the Makefile, and then just 'make' and
2222'make install'.
2323
24- This code requires libxml to be previously installed.
24+ By default, this module requires both libxml2 and libxslt to be installed
25+ on your system. If you do not have libxslt or do not want to use XSLT
26+ functions, you must edit the Makefile to not build the XSLT functions,
27+ as directed in its comments; and edit pgxml.sql.in to remove the XSLT
28+ function declarations, as directed in its comments.
2529
2630Description of functions
2731------------------------
2832
2933The first set of functions are straightforward XML parsing and XPath queries:
3034
31- xml_valid (document) RETURNS bool
35+ xml_is_well_formed (document) RETURNS bool
3236
3337This parses the document text in its parameter and returns true if the
34- document is well-formed XML.
38+ document is well-formed XML. (Note: before PostgreSQL 8.2, this function
39+ was called xml_valid(). That is the wrong name since validity and
40+ well-formedness have different meanings in XML. The old name is still
41+ available, but is deprecated and will be removed in 8.3.)
3542
3643xpath_string(document,query) RETURNS text
3744xpath_number(document,query) RETURNS float4
Original file line number Diff line number Diff line change 11--SQL for XML parser
22
3- CREATE OR REPLACE FUNCTION xml_valid (text) RETURNS bool
3+ CREATE OR REPLACE FUNCTION xml_is_well_formed (text) RETURNS bool
44 AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE;
55
6+ -- deprecated old name for xml_is_well_formed
7+ CREATE OR REPLACE FUNCTION xml_valid(text) RETURNS bool
8+ AS 'MODULE_PATHNAME', 'xml_is_well_formed' LANGUAGE C STRICT IMMUTABLE;
9+
610CREATE OR REPLACE FUNCTION xml_encode_special_chars(text) RETURNS text
711 AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE;
812
Original file line number Diff line number Diff line change @@ -24,4 +24,7 @@ DROP FUNCTION xpath_string(text,text);
2424
2525DROP FUNCTION xml_encode_special_chars(text );
2626
27+ -- deprecated old name for xml_is_well_formed
2728DROP FUNCTION xml_valid(text );
29+
30+ DROP FUNCTION xml_is_well_formed(text );
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ xmlChar *pgxml_texttoxmlchar(text *textstring);
4242static xmlXPathObjectPtr pgxml_xpath (text * document , xmlChar * xpath );
4343
4444
45- Datum xml_valid (PG_FUNCTION_ARGS );
45+ Datum xml_is_well_formed (PG_FUNCTION_ARGS );
4646Datum xml_encode_special_chars (PG_FUNCTION_ARGS );
4747Datum xpath_nodeset (PG_FUNCTION_ARGS );
4848Datum xpath_string (PG_FUNCTION_ARGS );
@@ -166,12 +166,12 @@ pgxml_parser_init()
166166
167167/* Returns true if document is well-formed */
168168
169- PG_FUNCTION_INFO_V1 (xml_valid );
169+ PG_FUNCTION_INFO_V1 (xml_is_well_formed );
170170
171171Datum
172- xml_valid (PG_FUNCTION_ARGS )
172+ xml_is_well_formed (PG_FUNCTION_ARGS )
173173{
174- /* called as xml_valid (document) */
174+ /* called as xml_is_well_formed (document) */
175175 xmlDocPtr doctree ;
176176 text * t = PG_GETARG_TEXT_P (0 ); /* document buffer */
177177 int32 docsize = VARSIZE (t ) - VARHDRSZ ;
Original file line number Diff line number Diff line change 1- <!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.174 2006/09/16 00:30:12 momjian Exp $ -->
1+ <!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.175 2006/09/16 16:18:11 tgl Exp $ -->
22
33 <chapter id="datatype">
44 <title id="datatype-title">Data Types</title>
@@ -3345,8 +3345,8 @@ SELECT * FROM pg_attribute
33453345
33463346 <para>
33473347 <filename>/contrib/xml2</> has a function called
3348- <function>xml_valid ()</> that can be used in a <literal>CHECK</>
3349- constraint to enforce that a field contains valid <acronym>XML</>.
3348+ <function>xml_is_well_formed ()</> that can be used in a <literal>CHECK</>
3349+ constraint to enforce that a field contains well-formed <acronym>XML</>.
33503350 It does not support validation against a specific <acronym>XML</>
33513351 schema. A server-side language with <acronym>XML</> capabilities
33523352 could be used to do schema-specific <acronym>XML</> checks.
You can’t perform that action at this time.
0 commit comments