xsl-list
[Top] [All Lists]

Re: [XSLT2] setting context inside funcdefs

2003-02-14 12:14:01
David Carlisle wrote:


apply-templates would also effectively re-establish the context but in
that case the code that uses the context isn't explictitly in the function body but rather in the template that gets applied.

so probably just xsl:for-each or within an xpath2 expression of the form
<xsl:value-of select="$callers_context-node/a/b/*[localname()....


I see, thanks for the explanation.

Here's what I have now:
(I had the $context before, but wasn't sure if I could eliminate redundant references by setting the focus to its context.)

  <t:function
    name="dx:default_class_values">
    <t:param name="context">
    <t:result>
      <value-of select="local-name($context)"/>
      <t:if test="string($context/@role)">
        <t:text> </t:text>
        <t:value-of select="$context/@role"/>
      </t:if>
    </t:result>
  </t:function>

Tobi


--
http://www.pinkjuice.com/


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list