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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers