Re: Initial review of xslt with no limits patch

Поиск
Список
Период
Сортировка
От Mike Fowler
Тема Re: Initial review of xslt with no limits patch
Дата
Msg-id 4C5B41B4.3020708@mlfowler.com
обсуждение исходный текст
Ответ на Re: Initial review of xslt with no limits patch  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: Initial review of xslt with no limits patch  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: Initial review of xslt with no limits patch  (Andrew Dunstan <andrew@dunslane.net>)
Re: Initial review of xslt with no limits patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi Pavel,

On 02/08/10 09:21, Pavel Stehule wrote:
> Hello
>
> 2010/8/2 Mike Fowler<mike@mlfowler.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:paramname="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-ofselect="$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:elementname="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.

Regards,

-- 
Mike Fowler
Registered Linux user: 379787


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Concurrent MERGE
Следующее
От: Tom Lane
Дата:
Сообщение: Re: including backend ID in relpath of temp rels - updated patch