[xml] xslt variable replacement element



I'm doing a lot of javascript at the moment. I find myself wanting
to do something like this:

  <xsl:template match="div">
    <div id="slider_area_{ class}">
       <div class="slider" id="slider_button_{ class}"/>
    </div>
    <xxslt:varsubst>
      <script>
        var slider = new Slider($("slider_area_{ class}"),
                                $("slider_button_{ class}"));
      </script>
    </xxslt:varsubst>
  </xsl:template>


So the { class} is interpolated correctly within the xxslt:varsubst
area (that's just an example definition).

Has anybody written an extension element like this or can suggest a
good way of going about it?

Is it a terrible idea?

-- 
Nic Ferrier
http://www.tapsellferrier.co.uk   



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]