[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Calling xsl: template through mode attribute prints only text nodes

Subject: Re: [xsl] Calling xsl: template through mode attribute prints only text nodes
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 29 Aug 2014 09:03:54 -0000

varun bhatnagar varun292006@xxxxxxxxx wrote:

I have a variable in which I have my Item tag. I have one template
defined for PackageNumber/@level (which is inside Item) for which I have
set mode="step2". I want to call the same functionality of this template
but with few modification. So I want to create 2 more templates for
PackageNumber/@level with mode="step3" and mode="step4". I will call
these based on certain conditions using apply-template tag like this,
<xsl:apply-templates select="PackNumber/@level" mode="step2" />;
<xsl:apply-templates select="PackNumber/@level" mode="step3" /> and
<xsl:apply-templates select="PackNumber/@level" mode="step4" />

I read in O'Relly's XSLT book that to process same set of nodes several
times, use mode attribute of xsl:template element. I want to do the
same. But if I call the template using mode it is printing only the text
nodes. How can I print the node-sets?

I did post a suggestion for the problem described in your previous mail, so please try whether that solves the problem as stated in that message. If it works then we have solved it and can move on, it does not make sense that you don't use the suggestion but then post a more complicated problem.

In XSLT 1.0 I think you will be forced to write an identity transformation template for any mode you want to use as it does not allow you to write a single one, as you can do in XSLT 2.0.

Current Thread