Subject: Re: determining whether an XPATH points to an element or attribute
From: "Joerg Heinicke" <joerg.heinicke@xxxxxx>
Date: Thu, 24 Jan 2002 03:13:19 +0100
|
> <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
|