xsl-list
[Top] [All Lists]

Re: q: could a template mode be used as a parameter or variable?; q: is there something like a default mode?

2003-01-13 00:14:28
alejandro david weil wrote:
I didn't found anything like that in tutorials nor spec. but it's possible i
missed something, i want to do:

<xsl:call-template name="some" mode="a"/>
<xsl:call-template name="some" mode="b"/>

<xsl:template name="some">
        blablabla

        <xsl:if test="??mode??='a'>
                do something here
        </xsl:if>

        blablabla
</xsl:template>
What's wrong with passing a parameter as you said? Isn't it more clear and robust?

Also, another question: is there something like a default mode, or a
global variable that says what mode should be called?
Not really. Much simpler: if apply-templates has a mode, it applies only to templates in the same mode. If it doesn't - it applies only to templates that don't have a mode.

I know i could do something like all of this with parameters, but..
Not something, but IMO exactly what you want to do.

--
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel


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



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