[xsl] Test for current node being an element or attribute?

Subject: [xsl] Test for current node being an element or attribute?
From: Georges Schmitz <georges.schmitz@xxxxxxxxx>
Date: Tue, 10 Dec 2002 14:03:04 +0100
Hi,

Is there a way in XSL to test the current node being an element or
attribute?

I'm using a copy template (recursively) that matches "@*|node()" and
would like to decide what to do (<xsl:choose>) depending on the text
content of the current node (nodes with arbitrary names, so no fix
testing possible!).

To point it out: I have to manipulate the contents of the nodes and
therefor I apply <xsl:element name="{name()}"> and
<xsl:attribute name="{name()}"> on these specific nodes (perhaps a
bad approach?). Some elements and attributes are simply copied,
others get a new content.

Tips appreciated,
Georges


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



Current Thread