[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: How to check is element has children.

Subject: RE: How to check is element has children.
From: Nielsen Anders Rolann <annie@xxxxxxxxxx>
Date: Fri, 16 Feb 2001 11:03:39 +0100
xsl check for children
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@xxxxxxxxxxxx]
Sent: 15. februar 2001 19:22
To: XSL list server (E-mail)
Subject:  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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.