xsl-list
[Top] [All Lists]

[xsl] node test on element of an attribute

2006-08-31 09:03:25
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

--~------------------------------------------------------------------
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>