Re: xpath_array with namespaces support

From: "Nikolay Samokhvalov" <samokhvalov(at)gmail(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: xpath_array with namespaces support
Date: 2007-04-17 05:26:12
Message-ID: e431ff4c0704162226g7dbd68f6q4874203ade3ba5c3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

It's also worth to take care of the very last lines of XML functions
doc (http://momjian.us/main/writings/pgsql/sgml/functions-xml.html)

"XML to SQL Mapping

This involves converting XML data to and from relational
structures. PostgreSQL has no internal support for such mapping, and
relies on external tools to do such conversions."

It's not quite rigth as of now, because "rel->XML" mapping
capabilities exist in the core: it's XML/SQL publishing functions and
alternative mapping functions (such as table_to_xml() ).

On 4/10/07, Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com> wrote:
> Here is new version that adds following changes:
> 4. Function is now strict, per discussion.
> 5. Return empty array in case when XPath expression detects nothing
> (previously, NULL was returned in such case), per discussion.
> 6. (bugfix) Work with fragments with prologue: select xpath('/a',
> '<?xml version="1.0"?><a /><b />'); // now XML datum is always wrapped
> with dummy <x>...</x>, XML prologue simply goes away (if any).
> 7. Some cleanup.
>
> On 4/4/07, Nikolay Samokhvalov <nikolay(at)samokhvalov(dot)com> wrote:
> > The patch attached contains following changes:
> > 1. The function name xmlpath() is changed to xpath();
> > 2. Approach of passing of namepspace mappings to the function is changed:
> > now that array (the 3rd argument) should be a 2-dimentional array with the
> > length of the second axis = 2 (e.g., ARRAY[ARRAY['a1', 'http://a1'],
> > ARRAY['a2', 'http://a2'], ARRAY['a2', 'http://a2']]);
> > 3. Description of xpath() function in docs (I'm sorry for possible
> > mistakes in English and docbook formatting, please check it...)
> >
> >
--
Best regards,
Nikolay

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Zoltan Boszormenyi 2007-04-17 07:15:34 Re: [HACKERS] Re: IDENTITY/GENERATED v36 Re: Final version of IDENTITY/GENERATED patch
Previous Message Tom Lane 2007-04-17 04:44:33 Re: Fwd: Strangely Variable Query Performance