xsl-list
[Top] [All Lists]

Re: Keeping a map in my XSL

2005-09-14 05:45:11
Le mercredi 14 septembre 2005 à 10:30 +0100, andrew welch a écrit :

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
------------------------------------------------------------------------


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>