You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Michele Bianchi <mi...@exsense.com> on 2000/05/22 17:36:25 UTC

how to get node name?

is there any way to get the node name inside a template?

example:

 <xsl:template match="first|last">
  <xsl:value-of select="$^%@$&%!"/>
 </xsl:template>

i'd like to print out "first" or "last".  i know i can write 2 template, but
i write a trivial example, my case is more complex.

thanks in advance.

-------------------------------------------------------------------------------
michele_bianchi                                  exsense | integrated_solutions
phone://+39_348_7651874                                       via_scrimiari_45b
http://mic.aesthetica.it                                     37132_verona_italy


Re: how to get node name?

Posted by Ulrich Mayring <ul...@denic.de>.
> > i'd like to print out "first" or "last".  i know i can write 2 template,
> > but
> > i write a trivial example, my case is more complex.
> 
> use the text() function.

Ugh. Was it too late yesterday? I mean the name() function of course.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: how to get node name?

Posted by Ulrich Mayring <ul...@denic.de>.
Michele Bianchi wrote:
> 
> is there any way to get the node name inside a template?
> 
> example:
> 
>  <xsl:template match="first|last">
>   <xsl:value-of select="$^%@$&%!"/>
>  </xsl:template>
> 
> i'd like to print out "first" or "last".  i know i can write 2 template,
> but
> i write a trivial example, my case is more complex.

use the text() function.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung