Re: [PATCH] Re: Issue: Deprecation of the XML2 module 'xml_is_well_formed' function - Mailing list pgsql-hackers

From Thom Brown
Subject Re: [PATCH] Re: Issue: Deprecation of the XML2 module 'xml_is_well_formed' function
Date
Msg-id AANLkTinpe73clXFmS7wi5ODK2Ox58M4AFJWFryccC6x6@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Re: Issue: Deprecation of the XML2 module 'xml_is_well_formed' function  (Mike Fowler <mike@mlfowler.com>)
Responses Re: [PATCH] Re: Issue: Deprecation of the XML2 module 'xml_is_well_formed' function
List pgsql-hackers
On 10 July 2010 14:12, Mike Fowler <mike@mlfowler.com> wrote:
> Robert Haas wrote:
>>
>> On Fri, Jul 9, 2010 at 4:06 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
>>
>>>
>>> On ons, 2010-07-07 at 16:37 +0100, Mike Fowler wrote:
>>>
>>>>
>>>> Here's the patch to add the 'xml_is_well_formed' function.
>>>>
>>>
>>> I suppose we should remove the function from contrib/xml2 at the same
>>> time.
>>>
>>
>> Yep
>
> Revised patch deleting the contrib/xml2 version of the function attached.
>
> Regards,
>
> --
> Mike Fowler
> Registered Linux user: 379787
>
sql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>
>

Would a test for mismatched or undefined namespaces be necessary?

For example:

Mismatched namespace:
<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</my:foo>

Undefined namespace when used in conjunction with IS DOCUMENT:
<pg:foo xmlns:my="http://postgresql.org/stuff">bar</pg:foo>

Also, having a look at the following example from the patch:
SELECT xml_is_well_formed('<local:data
xmlns:local="http://127.0.0.1";><local:piece id="1">number
one</local:piece><local:piece id="2" /></local:data>');xml_is_well_formed
--------------------t
(1 row)

Just wondering about that semi-colon after the namespace definition.

Thom


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: patch: to_string, to_array functions
Next
From: Pavel Stehule
Date:
Subject: Re: patch (for 9.1) string functions