This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: determining whether an XPATH points to an element or attribute
- From: "Joerg Heinicke" <joerg dot heinicke at gmx dot de>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 24 Jan 2002 03:13:19 +0100
- Subject: Re: [xsl] determining whether an XPATH points to an element or attribute
- References: <95B3DC792A040C45807C9CFA11B7B1AF02DE4757@OHISV4.nikonoa.net>
- Reply-to: xsl-list at lists dot mulberrytech dot com
> <xsl:template match="//tagname1[fads and @fads]/tagname2">
> <xsl:choose>
> <xsl:when test=" self::*"><!-- if it points to element -->
> <TagOperation>
> </xsl:when>
> <xsl:otherwise><!-- if it points to attribute-->
> <AttributeOperation>
> </xsl:otherwise>
> </xsl:choose>
> </xsl:template>
With this template only elements with name "tagname2" (and tagname1 as
parent, which ...) will be processed. So you don't need to test on element
or attribute.
Regards,
Joerg
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list