[PATCH] Re: Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

Mike Fowler <mike@mlfowler.com>

From: Mike Fowler <mike@mlfowler.com>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: Robert Haas <robertmhaas@gmail.com>, Mike Rylander <mrylander@gmail.com>, Mike Berrow <mberrow@gmail.com>, pgsql-hackers@postgresql.org
Date: 2010-07-07T15:37:40Z
Lists: pgsql-hackers

Attachments

Peter Eisentraut wrote:
> On lör, 2010-07-03 at 09:26 +0100, Mike Fowler wrote:
>   
>> What I will do  
>> instead is implement the xml_is_well_formed function and get a patch  
>> out in the next day or two. 
>>     
>
> That sounds very useful.
>   
Here's the patch to add the 'xml_is_well_formed' function. Paraphrasing 
the SGML the syntax is:

|xml_is_well_formed|(/text/)

The function |xml_is_well_formed| evaluates whether the /text/ is well 
formed XML content, returning a boolean. I've done some tests (included 
in the patch) with tables containing a mixture of well formed documents 
and content and the function is happily returning the expected result. 
Combining with IS (NOT) DOCUMENT is working nicely for pulling out 
content or documents from a table of text.

Unless I missed something in the original correspondence, I think this 
patch will solve the issue.

Regards,

-- 
Mike Fowler
Registered Linux user: 379787