[xsl] node test on element of an attribute

Subject: [xsl] node test on element of an attribute
From: Georges Schmitz <georges.schmitz@xxxxxxxxx>
Date: Thu, 31 Aug 2006 18:02:08 +0200
While recursively copying and manipulating an xml tree, I need to handle the same attribute differently, depending on its element.

I have:
1) entity/@vo-name
2) property/@vo-name

I hoped to be able to treat this in one template match for @vo-name, something like

<xsl:template match="@vo-name" mode="copy-modify">
 <xsl:variable name="temp">
   <xsl:choose>
     <xsl:when test="~something with entity~" >...</xsl:when>
     <xsl:when test="~something with property~" >...</xsl:when>
   ...

and to distinguish them in between the template (eg. with xsl:choose). But is there an appropriate test for the node name, when my current node is an attribute? Obviously I can't say "parent::entity".

Solution may be XSLT2.0

Many thanks,
Georges

Current Thread