Article View: fr.comp.text.xml
Article #9156Re: [xslt] Iteration sur la valeur d'un parametre
From: Joel Fillon
Date: Thu, 17 May 2001 10:09
Date: Thu, 17 May 2001 10:09
41 lines
2068 bytes
2068 bytes
Alain Ketterlin a οΏ½crit :
> > Est-ce qu'il existe une facon de s'en sortir autrement ?
>
> Oui en general, mais non standard. Tout depend du processeur que tu
> utilises. D'habitude, cela s'appelle nodeset() ou node-set()...
>
> (C'etait prevu dans feu XSLT 1.1, et ce sera surement dans 2.0.)
>
> -- Alain.
Cette solution semble marcher :
<xsl:stylesheet xmlns:alias="http://www.w3.org/1999/XSL/Transform"
xmlns:lxslt="http://xml.apache.org/xslt/java">
<xsl:template name="t">
<xsl:param name="p"/>
<xsl:variable name="nodeset"
select="lxslt:org.apache.xalan.xslt.extensions.Nodeset.new()"/>
<xsl:variable name="iterator" select="lxslt:nodeset($nodeset,
$p)"/>
<xsl:for-each select="$iterator/*">
...
</xsl:for-each>
</xsl:template>
<xsl:template match="/">
<xsl:call-template name="t">
<xsl:with-param name="p">
<elem1/>
<elem2/>
<elem3/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
Mais si il y a plus simple, je suis preneur !
Joel
Technical Details
Message-ID:
<3B03A35C.BF15F9C7@sophia.inria.fr>Path:
arc1-ca.pugleaf.net!archiver1.sj.google.com!newsfeed.google.com!newsfeed.stanford.edu!skynet.be!isdnet!ciril.fr!univ-angers.fr!univ-rennes1.fr!irisa.fr!news-rocq!news-sop.inria.fr!not-for-mailReferences:
<3B02B1A9.F7004F38@sophia.inria.fr> <wyk83hmanf.fsf@polya.u-strasbg.fr>Show Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII X-Google-Thread: 114f60,c5caf1910eaf78cf X-Google-Attributes: gid114f60,public X-Google-ArrivalTime: 2001-05-17 03:19:04 PST Path: arc1-ca.pugleaf.net!archiver1.sj.google.com!newsfeed.google.com!newsfeed.stanford.edu!skynet.be!isdnet!ciril.fr!univ-angers.fr!univ-rennes1.fr!irisa.fr!news-rocq!news-sop.inria.fr!not-for-mail From: Joel Fillon <Joel.Fillon@sophia.inria.fr> Newsgroups: fr.comp.text.xml Subject: Re: [xslt] Iteration sur la valeur d'un parametre Date: Thu, 17 May 2001 12:09:32 +0200 Organization: INRIA Sophia Antipolis Lines: 41 Message-ID: <3B03A35C.BF15F9C7@sophia.inria.fr> References: <3B02B1A9.F7004F38@sophia.inria.fr> <wyk83hmanf.fsf@polya.u-strasbg.fr> NNTP-Posting-Host: flambis.inria.fr Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mozilla 4.75 [fr] (Windows NT 5.0; U) X-Accept-Language: fr-FR,en