From: | Hannu Krosing <hannu(at)2ndQuadrant(dot)com> |
---|---|
To: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com> |
Subject: | Re: xpath processing brain dead |
Date: | 2009-03-01 22:35:22 |
Message-ID: | 1235946922.8441.44.camel@huvostro |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sun, 2009-03-01 at 10:13 -0500, Andrew Dunstan wrote:
>
> Hannu Krosing wrote:
> >> Some of the functions, including some specified in the standard, produce
> >> fragments. That's why we have the 'IS DOCUMENT' test.
> >>
> >
> > But then you could use xmlfragments as the functions return type, no ?
> >
> > Does tha standard require that the same field type must store both
> > documents and fragments ?
> >
> >
>
> Yes, the standard very explicitly provides for one XML type which need
> not be an XML document. We have no choice about that.
What is it then ? A sequence of XML elements ?
Which standard does postgreSQL XML type need to confirm to - general XML
DB, Xpath or some other XML ?
XML Path Language (XPath) Version 1.0
--------------------------------------
starts with this Abstract:
"XPath is a language for addressing parts of an XML document, designed
to be used by both XSLT and XPointer."
So I think that using Xpath on anything else than "XML document" is
invalid and results are undefined.
XML 1.0 and XML 1.1
-------------------
Also, both XML 1.0 and XML 1.1 standards are about a thing called an
"XML document", so I don't see anything there, which would make us
accept anything else as being "XML".
And SQL 2008, Part 14: XML-Related Specifications (SQL/XML)
-----------------------------------------------------------
Says:
"SQL defines a predefined data type named by the following <key word>:
XML.
...
The data types XML(DOCUMENT(UNTYPED)), XML(DOCUMENT(ANY)),
XML(DOCUMENT(XMLSCHEMA)), XML(CONTENT(UNTYPED)), XML(CONTENT(ANY)),
XML(CONTENT(XMLSCHEMA)), and XML(SEQUENCE) are referred to as the XML
types. Values of XML types are called XML values."
So while the type itself could be called XML, there are several
subtypes, like Document, Content and Sequence
Could the XML(SEQUENCE) better be represented as an array
of xml documents aka. xml[] , and maybe CONTENT could be done as
xmlelement[] where xmlelement can be any single XML element, including
CDATA and plain text ?
> cheers
>
> andrew
--
Hannu Krosing http://www.2ndQuadrant.com
PostgreSQL Scalability and Availability
Services, Consulting and Training
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Dunstan | 2009-03-01 23:22:46 | Re: xpath processing brain dead |
Previous Message | Sushant Sinha | 2009-03-01 22:21:26 | patch for space around the FragmentDelimiter |