cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brian moseley ...@maz.org>
Subject OT: tricky xsl question
Date Thu, 02 Mar 2000 12:34:45 GMT

hi folks, sorry for the off topic post, but i figure
somebody on this list must know how to solve this problem.

my source document contains something like this:

  <contract>
    <service name="mail">
    <service name="calendar">
  </contract>

my stylesheet has these definitions:

  <xsl:variable name="text.mail">Mail</xsl:variable>
  <xsl:variable name="text.calendar">Calendar</xsl:variable>

it also has the following template:

  <xsl:template match="service">
    <a href=""><xsl:value-of select="@name"/></a><br/>
  </xsl:template>

what i really want to get is the value of the text.*
variable associated with the service, instead of the value
of the name attribute of the service. ie, 'Calendar' instead
of 'calendar'. make sense? and no, i don't have the option
of simply naming the variable 'calendar', instead of
'text.calendar'.

is there a way to dynamically compose an expression? no
amount of syntactic monkeying has revealed a solution.
looking through the xslt spec i notice the key function,
maybe that's actually what i'm looking for, but i'm too dum
tonight to grok it.


Mime
View raw message