Re: [xsl] how to find parent node

Subject: Re: [xsl] how to find parent node
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 23 Jan 2007 15:04:24 GMT
> 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