Skip site navigation (1) Skip section navigation (2)

Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

From: Mike Berrow <mberrow(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Issue: Deprecation of the XML2 module 'xml_is_well_formed' function
Date: 2010-06-28 15:03:17
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
We need to make extensive use of the 'xml_is_well_formed' function provided
by the XML2 module.

Yet the documentation says that the xml2 module will be deprecated since
"XML syntax checking and XPath queries"
is covered by the XML-related functionality based on the SQL/XML standard in
the core server from PostgreSQL 8.3 onwards.

However, the core function XMLPARSE does not provide equivalent
functionality since when it detects an invalid XML document,
it throws an error rather than returning a truth value (which is what we
need and currently have with the 'xml_is_well_formed' function).

For example:

select xml_is_well_formed('<br></br2>');
(1 row)

select XMLPARSE( DOCUMENT '<br></br2>' );
ERROR:  invalid XML document
DETAIL:  Entity: line 1: parser error : expected '>'
Entity: line 1: parser error : Extra content at the end of the document

Is there some way to use the new, core XML functionality to simply return a
truth value
in the way that we need?.

-- Mike Berrow


pgsql-hackers by date

Next:From: Mike BerrowDate: 2010-06-28 15:08:53
Subject: Issue: Deprecation of the XML2 module 'xml_is_well_formed' function
Previous:From: Tom LaneDate: 2010-06-28 14:53:24
Subject: Re: get_whatever_oid, part 1: object types with unqualifed names

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group