xsl-list
[Top] [All Lists]

Testing if attribute node

2004-01-19 18:17:17
Hi

I'm genenerating stylesheets (with XSLT) from the following XML fragment (example):

<rule match="elt"/>
<rule match="elt/@someattr"/>

Those rules gives me templates after a transform:

<xsl:template match="elt">
...
</xsl:template>

<xsl:template match="elt/@someattr">
...
</xsl:template>

I want to do some conditionals inside the templates based on whether the current node is an attribute or not. Is that possible to do?

My alternative, as I see it, is to parse the match attribute when I generate the stylesheet and put a variable inside the templates but I really don't want to do that.

Any suggestions are welcome (even those that completely alters my approach :)

/Marcus

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



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