From: Peter Eisentraut on
On fre, 2010-07-30 at 12:50 +0100, Mike Fowler wrote:
> > * xml_is_well_formed returns true for simple text
> >
> > postgres=# SELECT xml_is_well_formed('ssss');
> > xml_is_well_formed
> > --------------------
> > t
> > (1 row)
> >
> > it is probably wrong result - is it ok??
> >
>
> Yes this is OK, pure text is valid XML content.

Are you speaking of XML content fragments that SQL/XML defines?

Well-formedness should probably only allow XML documents.


--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Robert Haas on
On Sat, Jul 31, 2010 at 8:10 AM, Peter Eisentraut <peter_e(a)gmx.net> wrote:
> On fre, 2010-07-30 at 12:50 +0100, Mike Fowler wrote:
>> > * xml_is_well_formed returns true for simple text
>> >
>> > postgres=# SELECT xml_is_well_formed('ssss');
>> > � xml_is_well_formed
>> > --------------------
>> > � t
>> > (1 row)
>> >
>> > it is probably wrong result - is it ok??
>> >
>>
>> Yes this is OK, pure text is valid XML content.
>
> Are you speaking of XML content fragments that SQL/XML defines?
>
> Well-formedness should probably only allow XML documents.

I think the point of this function is to determine whether a cast to
xml will throw an error. The behavior should probably match exactly
whatever test would be applied there.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Mike Fowler on
On 02/08/10 07:46, Pavel Stehule wrote:

>>
>> I have not any suggestions now - so I'll change flag to "ready to commit"
>
> sorry - contrib module should be a fixed
>
> patch attached
>

Thanks Pavel, you saved me some time!

Regards,

--
Mike Fowler
Registered Linux user: 379787

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Peter Eisentraut on
On lör, 2010-07-31 at 13:40 -0400, Robert Haas wrote:
> > Well-formedness should probably only allow XML documents.
>
> I think the point of this function is to determine whether a cast to
> xml will throw an error. The behavior should probably match exactly
> whatever test would be applied there.

Maybe there should be

xml_is_well_formed()
xml_is_well_formed_document()
xml_is_well_formed_content()

I agree that consistency with SQL/XML is desirable, but for someone
coming from the outside, the unqualified claim that 'foo' is well-formed
XML might sound suspicious.


--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Pavel Stehule on
Hello

2010/8/3 Peter Eisentraut <peter_e(a)gmx.net>:
> On lör, 2010-07-31 at 13:40 -0400, Robert Haas wrote:
>> > Well-formedness should probably only allow XML documents.
>>
>> I think the point of this function is to determine whether a cast to
>> xml will throw an error.  The behavior should probably match exactly
>> whatever test would be applied there.
>
> Maybe there should be
>
> xml_is_well_formed()
> xml_is_well_formed_document()
> xml_is_well_formed_content()
>
> I agree that consistency with SQL/XML is desirable, but for someone
> coming from the outside, the unqualified claim that 'foo' is well-formed
> XML might sound suspicious.
>

yes, it is little bit curious - but it can be just documented. Now, I
don't think, so we need more functions.

Regards

Pavel

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers