Altova Mailing List Archives

Re: [xsl] How to use mode

From: Goetz Bock <bock@----------->
Date: 6/26/2001 1:38:00 AM
On Tue, Jun 26 '01 at 11:18, Griebel, Peer wrote:
> 1. Is a mode preserved? More precisely: If I call 
> 	<xsl:apply-templates mode="some-mode"/>
> And some called templated itself calls apply-templates, is it still in mode
> some-mode? 
No, but that is not a problem, if you do:
<xsl:apply-templates select="foo" mode="bar">
the template:
<xsl:template match="foo" />
will not be called, only
<xsl:template match="foo" mode="bar"/>
and there you can simply do:
<xsl:template match="foo" mode="bar">
  <!-- do something -->
  <xsl:apply-templates mode="bar"/>
to keep your mode.

> 2. How do I switch back to default mode? Templates specified without a mode
> are in default mode. But how can I call a template without a mode
> specification?
what about <xsl:apply-templates />

> 3. How can I combine modes?
You can't, but

<xsl:apply-templates mode="some-mode"/>
<xsl:apply-templates mode="some-other-mode"/>

should have the desired effect. But are you sure you realy need modes.


Description: PGP signature


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.