[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: "varun bhatnagar varun292006@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 29 Aug 2014 09:35:15 -0000

Sorry if I have mislead you Martin, but the suggestion given in the above
mail did not work as it prints both node-sets and text-nodes, that is why I
replied back again (so I tried your suggestion) and I thought of explaining
it in a better way with my actual scenario because in my first mail I just
said that I have 3 conditions. So it was already a complicated problem I
did not post a new one.

Thanks for your suggestions....you are always a savior :)


On Fri, Aug 29, 2014 at 11:04 AM, Martin Honnen martin.honnen@xxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> 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