xsl-list
[Top] [All Lists]

RE: Testing if attribute node

2004-01-19 19:05:01
I'm not exactly certain I understand what you are saying, but I will
attempt to help you.


<xsl:template match="elt">
        <xsl:if test="parent::*/attribute::*"> <!--if node has
attributes-->
                <xsl:value-of select="."/> <!--apply your processing-->
        </xsl:if>
</xsl:template>

<xsl:template match="elt/@match">
        <xsl:if test="parent::*/attribute::*">
                <xsl:value-of select="."/>
        </xsl:if>
</xsl:template>

</xsl:stylesheet>

I hope this helps.

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
David
Carlisle
Sent: Monday, January 19, 2004 8:35 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Testing if attribute node



test="self::* " is true on element nodes but not attributes.
A fuller test for all node types was posted on this list
the other day, it's probably in thef aq.

David
-- 
http://www.dcarlisle.demon.co.uk/matthew

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>