Re: [xsl] combining multiple documents

Subject: Re: [xsl] combining multiple documents
From: Florent Georges <lists@xxxxxxxxxxxx>
Date: Sun, 27 Jan 2008 16:56:05 +0100 (CET)
Steven Ericsson-Zenith wrote:

> As far as I am aware templates do not change their behavior because
> of an implied context change.

> Keys, apparently, do.

  I think the following example should make my point more clear:


       <xsl:output indent="yes"/>

       <xsl:variable name="d1">
          <e a="1"/>
          <e a="2"/>
          <e a="3"/>

       <xsl:variable name="d2">
          <e a="3"/>
          <e a="2"/>
          <e a="3"/>

       <xsl:key name="k" match="e" use="@a"/>

       <xsl:template name="t">
          <xsl:param name="a"/>
          <xsl:sequence select="e[@a eq $a]"/>

       <xsl:template name="initial">
             <xsl:for-each select="$d1, $d2">
                   <xsl:copy-of select="key('k', '3')"/>
                   <xsl:call-template name="t">
                      <xsl:with-param name="a" select="'3'"/>




Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail

Current Thread