xsl-list
[Top] [All Lists]

Re: [xsl] how to find parent node

2007-01-23 08:23:54
Hi:

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

On 1/23/07, David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> 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




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>