Hi,

I'd like to propose the implementation of XMLDocument (SQL/XML X030).It basically returns an XML document from a given XML expression, e.g.

SELECT
  xmldocument(
    xmlelement(NAME foo,
      xmlattributes(42 AS att),
      xmlelement(NAME bar,
        xmlconcat('va', 'lue'))
    )
  );

             xmldocument
--------------------------------------
 <foo att="42"><bar>value</bar></foo>
(1 row)

XMLDocument doesn't do much. In fact, it might be reduced to a simple xmlparse() call as XMLOPTION_DOCUMENT...

xmlparse(data, XMLOPTION_DOCUMENT, true)

... to make sure that the given XML expression is a valid document - still need some more research there. One could argue that XMLDocument() is in most cases unnecessary, but I believe it would facilitate the migration of scripts from other database products.

Any thoughts?

Best, Jim



Reply via email to