This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: determining whether an XPATH points to an element or attribute


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]