Re: [xsl] how to find parent node

Subject: Re: [xsl] how to find parent node
From: xslt.new <xslt.new@xxxxxxxxx>
Date: Tue, 23 Jan 2007 09:23:33 -0600
Hi:

If using name() is not a good idea, are there other ways to find the parent?

On 1/23/07, David Carlisle <davidc@xxxxxxxxx> wrote:

> And I want to find out the parent of test1 in the <test1> template > itself. I tried <xsl:value-of select="name(parent::*)"/>. This works > only if <test1> is directly under <element1> and not under <para> >

why do you say it doesn't work under para?
If you execute that code when the current element is the test1 eleemnt
in your example, it will return "para" which is the name of the parent.
(although actually it's usually a bad idea to use the name() function)

David

Current Thread