This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: How to check is element has children.
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] How to check is element has children.
- From: Nielsen Anders Rolann <annie at wmdata dot com>
- Date: Fri, 16 Feb 2001 11:03:39 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
Maby this will help you!
1) First solution is!
<xsl:apply-templates select="element[*]"/> (Test so see if there ar any
children)
<xsl:apply-templates select="element[not(*)]"/> (This test to see, that
there ar no children)
2) The more neat solution is:
<xsl:apply-templates select="element"/>
<xsl:template match="element[not(*)]">
Here you will do Your stuff, when there are no children!
</xsl:template>
<xsl:template match="element[(*)]">
Here you will do Your stuff, when there are children!
</xsl:template>
/Anders Rolann
-----Original Message-----
From: Rush, Marc [mailto:mrush@chipdata.com]
Sent: 15. februar 2001 19:22
To: XSL list server (E-mail)
Subject: [xsl] How to check is element has children.
I am finally making my way to learning XSL and have made some decent
progress. However, need a bit of help with what I assume is a simple
question. I need to test if an element has children so that I can apply
a style to it in the trasformation to HTML. Appreciate the help.
Thanks
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list