RE: Crazy idea

Subject: RE: Crazy idea
From: Marco.Mistroni@xxxxxxxxx
Date: Mon, 13 Sep 1999 17:06:05 +0300
Hi James,
	i was wondering about one thing: is it possible to include in the
xsl spec/path statement like 
<xsl:apply-templates match="tag/name" where "tag/name" ="blah" in a sort of
SQL syntax??
it is simply a question, i would be interested in that...
best regards
		marco

> -----Original Message-----
> From: EXT James Clark [mailto:jjc@xxxxxxxxxx]
> Sent: 13. September 1999 15:02
> To: xsl-list@xxxxxxxxxxxxxxxx
> Subject: Re: Crazy idea
> 
> 
> Francis Norton wrote:
> 
> > I was thinking of an extension to XSLT (I know, it's too 
> late for this
> > version).
> > 
> > Something like:
> > 
> > <xsl:function name="reverse" namespace:fn="www.redrice.com">
> >         <xsl:param name="string" />
> >         <xsl:if test="$string">
> >                 <xsl:value-of 
> select="fn:reverse(substring($string,2))" />
> >         </xsl:if>
> >         <xsl:value-of select="substring($string,1,1)" />
> > </xsl:function>
> > 
> > so I could then call it with
> > 
> > <xsl:stylesheet indent-result="yes" default-space="strip"
> >         xmlns:xsl="http://www.w3.org/XSL/Transform/1.0";
> >         xmlns:fn="www.redrice.com">
> > 
> > ...
> > 
> > <xsl:value-of select="fn:reverse('able was I ere I saw Elba')" />
> 
> The trouble with that is that functions would only be able to return
> result tree fragments. I had been thinking of something like:
> 
> <xsl:variable name="reverse"
>  select="function($s)
>           (concat($s ? $reverse(substring($s,2)) : '',
> substring($s,1,1)))"/>
> 
> <xsl:value-of select="$reverse('able was I ere I saw Elba')"/>
> 
> Something like you suggest would be useful too (I would think 
> of it as a
> way to call named templates from functions).
> 
> There are plenty of interesting possibilities for XSLT/XPath v2.
> 
> James
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread