RE: [xsl] Looking for a shorter mapping expression

Subject: RE: [xsl] Looking for a shorter mapping expression
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 5 Dec 2004 22:22:47 -0000
> Could someone, please, suggest a more compact expression, equivalent
> to the value of the "select" attribute below:
> 
>       <xsl:sequence select=
>        "for $this in $pList1 return
>           f:apply($pFun, $this)"
>       />
> 
> It seems to me that this is illegal:
> 
>      $pList1/ f:apply($pFun, .)
> 

I'm not sure you regard it as more compact, but if you want to do a mapping
that uses the context item rather than a range variable, you can do it at
the XSLT level:

<xsl:for-each select="$pList1">
  <xsl:sequence select="f:apply($pFun, .)"/>
</xsl:for-each>

This construct works for all (combinations of) sequences, whether they
contain nodes or atomic values.

Michael Kay
http://www.saxonica.com/

Current Thread