Re: Initial review of xslt with no limits patch

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Mike Fowler <mike(at)mlfowler(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Initial review of xslt with no limits patch
Date: 2010-08-06 03:11:04
Message-ID: AANLkTikoy3Mg70nhdMAfAK1WqShkCY43uiULec9B4EO7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/8/6 Mike Fowler <mike(at)mlfowler(dot)com>:
> Hi Pavel,
>
> On 02/08/10 09:21, Pavel Stehule wrote:
>>
>> Hello
>>
>> 2010/8/2 Mike Fowler<mike(at)mlfowler(dot)com>:
>>>
>>> Hi Pavel,
>>>
>>> Currently your patch isn't applying to head, from the looks of things a
>>> function signature has changed. Can you update your patch please?
>>>
>>
>> yes - see attachment
>>
>
> Thanks, the new patch applies cleanly. However I've been attempting to run
> the parameterised XSLT this evening but to no avail. Reverting your code
> I've discovered that it does not work in the old version either.
>
> Given the complete lack of documentation (not your fault) it's always
> possible that I'm doing something wrong. Given the query below, you should
> get the XML that follows, and indeed in oXygen (a standalone XML tool) you
> do:
>
> SELECT
> xslt_process('<employee><name>cim</name><age>30</age><pay>400</pay></employee>'::text,
> $$<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
>   <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
>   <xsl:strip-space elements="*"/>
>   <xsl:param name="n1"/>
>   <xsl:param name="n2"/>
>   <xsl:param name="n3"/>
>   <xsl:param name="n4"/>
>   <xsl:param name="n5" select="'me'"/>
>   <xsl:template match="*">
>     <xsl:element name="samples">
>       <xsl:element name="sample">
>         <xsl:value-of select="$n1"/>
>       </xsl:element>
>       <xsl:element name="sample">
>         <xsl:value-of select="$n2"/>
>       </xsl:element>
>       <xsl:element name="sample">
>         <xsl:value-of select="$n3"/>
>       </xsl:element>
>       <xsl:element name="sample">
>         <xsl:value-of select="$n4"/>
>       </xsl:element>
>       <xsl:element name="sample">
>         <xsl:value-of select="$n5"/>
>       </xsl:element>
>     </xsl:element>
>   </xsl:template>
> </xsl:stylesheet>$$::text, 'n1=v1,n2=v2,n3=v3,n4=v4,n5=v5'::text)
>
> <samples>
>  <sample>v1</sample>
>  <sample>v2</sample>
>  <sample>v3</sample>
>  <sample>v4</sample>
>  <sample>v5</sample>
> </samples>
>
> Sadly I get the following in both versions:
>
> <samples>
>  <sample/>
>  <sample/>
>  <sample/>
>  <sample/>
>  <sample/>
> </samples>
>
>
> Unless you can see anything I'm doing wrong I suggest we mark this patch
> either 'Returned with feedback' or 'Rejected'. Since contrib/xml2 is
> deprecated, perhaps a better way forward is to pull XSLT handling into core
> and fix both the apparent inability to handle parameters as well as the
> limited number of parameters.

there is some wrong, but I am not able to sey what now. But this patch
is very simply. I'll fix it today.

Pavel

>
> Regards,
>
> --
> Mike Fowler
> Registered Linux user: 379787
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2010-08-06 03:37:05 Re: Initial review of xslt with no limits patch
Previous Message Greg Stark 2010-08-06 02:44:30 Re: BUG #5599: Vacuum fails due to index corruption issues