[xml] libxml/xpath integration with postgresql

Date view Thread view Subject view Author view

From: Vincent Trussart (trussarv@cirano.umontreal.ca)
Date: Thu Jun 29 2000 - 23:08:41 EDT


Hi,

        I built a small C function for postgresql (a
fonction defined as a shared object that gets linked
when needed) that performs matching in an XML document
stored in a "TEXT" column using an XPath expression.

        This is quite usefull since it allows the storage
of XML documents as free text (instead of breaking it
up in fragments according to the DTD and linking elements
and nodes using foreign keys....)
while still being able to take advantage of its structure
for querying.

        Much work remains to be done Currently,
I only return a boolean saying "it matches something
 or not" but I would like to return what was matched.
What is returned by the XPath evaluation depends on
the expression itself. It would be easy to do
as much functions as there is return types...

float xpath_number(xmldata, xpathexpression)
text xpath_text(xmldata, xpathexpression)
.
.
.

...and fail if the return type of the xpath evaluation is
not compatible. Even with this approach, it would be
difficult to return a nodeset...

It would be possible to define a new datatype in postgres,
for a node in a nodeset but
this is not really portable; it would not be possible to
use this function through jdbc, for example...

Moreover, can a postgres function return an enumeration
(a node set)?

As you can see, I need feedback and design ideas...

PS: I someone wants the function, I can make it accessible.
(it was derived from the testXPath.c example. Basically, I only
did the bindings with postgresql)

PPS: I will be away for 2 weeks starting Saturday morning...

----
Message from the list xml@xmlsoft.org
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@xmlsoft.org


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:30:18 EDT