Subject: RE: [xsl] How to check is element has children. From: Nielsen Anders Rolann <annie@xxxxxxxxxx> Date: Fri, 16 Feb 2001 11:03:39 +0100 |
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: [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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] How to check is element h, Michael Kay | Thread | [xsl] List-style-type, Carmelo Montanez |
Re: [xsl] XSLT 1.1 comments, David Carlisle | Date | Re: [xsl] choose an "artificial" ro, David Carlisle |
Month |