XML Todo
From pgwiki
WARNING: This page has been migrated to the PostgreSQL Wiki. Please do not edit this page or your changes may be lost!
These are the issues that need to be or should be worked on for the XML type support in PostgreSQL.
[edit]
Required
- XMLVALIDATEDTD
- The current name of this function is XMLVALIDATE, which is not correct (see XMLVALIDATE definition in the standard paper)
- Allow passing DTDs via URIs?
- There is no words regarding XMLVALIDATEDTD in the documentation
- --with-libxslt
- Add smth like "(for contrib only)" notice to configure's help (AFAIK, --with-ossp-uuid needs such a notice too)
- xpath_exists()
- xpath_exists() is needed. It checks, whether or not the path specified exists in the XML value. (W/o this function we need to use weird "array_dims(xpath(...)) IS NOT NULL" syntax.)
- Indexes
- Simplify creating btree and GIN indexes for XML data
[edit]
Optional
- Data structure
- Native structure for XML type (implement Infoset, XDM and SQL/XML aspects). (Nikolay)
- Index-optimized XPath
- Effective XPath (Idea: use GiST/Gin to build a kind of index, supporting some numbering scheme to allow fast performance of simple XPath expressions evaluation). Function can be called as XMLPATH (non-standard). (Nikolay)
- XQuery
- XMLQUERY (from SQL/XML standard) - big task, entire langugage embedded in SQL. (Nikolay)
- XML Schema
- XSD validation. (Nikolay)
- XML_SCHEMAS view in the information schema. (Nikolay)
- Extra SQL/XML 2006 functions
- XMLDOCUMENT (instead of XMLROOT, which is from SQL/XML:2003) (Nikolay)
- Add XMLCAST, XMLTEXT (Nikolay)
- Inline ORDER BY for XMLAGG
- Example: "... XMLAGG(XMLELEMENT(...) ORDER BY col1) ...". (Nikolay)
- Namespaces
- XMLNAMESPACES support in XMLELEMENT and elsewhere
[edit]
Nonstandard Features
Here is a list of ideas of functionality that might be good to have available but which is not covered by the SQL/XML standard. Maybe some of these can be collected in an "XML toolbox" on PgFoundry or in contrib.
Add your own ideas here.
- DTD and XSD validation
- There is currently an implementation of XMLVALIDATE that does this. But note that XMLVALIDATE should work on XML schemas, not DTDs. The current implementation is all wrong. (Peter)
- Allow passing DTD to XMLVALIDATE as a simple VARCHAR string, not only as an URI. (Nikolay)
- Relax-NG
- Also a useful way to validate XML data. libxml2 supports this.
- XSLT
- Already available in contrib/xml2, but needs API fixes and adaptation to xml type.
- XML Canonical
- Convert XML documents to canonical form to compare them. libxml2 has support for this.
- Pretty-printing XML
- Parse a document and serialize it back in some indented form. libxml2 might support this.
- Shredding
- In some cases shredding could be better option (if there is no need in keeping XML docs entirely; if we have already developed tools that understand only relational data; etc) -- it would be a separate module that implements annotated schema decomposition technique, similar to DB2 and SQL Server functionality. (Nikolay)

