Re: [xsl] Keeping a map in my XSL

Subject: Re: [xsl] Keeping a map in my XSL
From: Eric van der Vlist <vdv@xxxxxxxxxxxx>
Date: Wed, 14 Sep 2005 14:45:11 +0200
Le mercredi 14 septembre 2005 ` 10:30 +0100, andrew welch a icrit :

> No need for document(''), just access the variable directly:
> 
> <xsl:variable name="map">
>   <map>
>      <key name="blah" value="blah"/>
>      ....
>   </map>
> </xsl:variable>
> 
> and 
> 
> <xsl:for-each select="$map">
>   <xsl:value-of select="key('mappings', $lookup)/@value"/>

Except that, if you are working in XSLT 1.0 (which is my case), your
variable would be a RTF and that using an extension function to convert
it into a node set would make your transformation less portable...

Maybe that would be a good practice to indicate in the subject if the
question is related to XSLT 1.0 or 2.0: these are two different
languages!

Eric

-- 
Don't you think all these XML schema languages should work together?
                                                         http://dsdl.org
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------

Current Thread