You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Lars Martin <la...@softwarebuero.de> on 2000/02/08 19:29:36 UTC

XSLT: How to get the element name

Hi all,

is it possible to get the name of the current element transformed
by XSLT? Something like:

...
<xsl:template match="*">
  unknown element: <xsl:element-name/>
  <xsl:apply-templates/>
</xsl:template>
...

We have documents where we don't know each element name, so we
can't specify templates for these unknown elements. I just want
to know the string matched by 'match="*"'.

Thanks,
Lars
--
________________________________________________________________
Lars Martin                         mailto:lars@softwarebuero.de
softwarebuero m&b (SMB)              http://www.softwarebuero.de

Re: How to get the element name

Posted by Steve Muench <sm...@us.oracle.com>.
<xsl:value-of select="name(.)"/>

should do it.

__________________________________________________________
Steve Muench, Lead XML Evangelist / Consulting Product Mgr
Oracle Corp, Business Components for Java Development Team
http://technet.oracle.com/tech/xml
----- Original Message ----- 
From: "Lars Martin" <la...@softwarebuero.de>
To: <xa...@xml.apache.org>
Sent: Tuesday, February 08, 2000 10:29 AM
Subject: XSLT: How to get the element name



Hi all,

is it possible to get the name of the current element transformed
by XSLT? Something like:

...
<xsl:template match="*">
  unknown element: <xsl:element-name/>
  <xsl:apply-templates/>
</xsl:template>
...

We have documents where we don't know each element name, so we
can't specify templates for these unknown elements. I just want
to know the string matched by 'match="*"'.

Thanks,
Lars
--
________________________________________________________________
Lars Martin                         mailto:lars@softwarebuero.de
softwarebuero m&b (SMB)              http://www.softwarebuero.de