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

Testing if a nodeset is empty

Subject: Testing if a nodeset is empty
From: "Nicholas Waltham" <info@xxxxxxxxxxxx>
Date: Mon, 1 Oct 2001 09:52:04 +0200
nodeset is
Hello All,
 I am trying to avoid certain kinds of empty tags in my xml output. Looking
at the following template, I would like to avoid an empty <chapter> tag.
Unfortunately this template does not work, it always shows the chapter tags
even if they are emtpy, what am I am doing wrong?

Thanks in advance,
Nicholas Waltham


<xsl:template match="transcal/file/section">
<xsl:variable name="a"><xsl:apply-templates select="p[@stylename='heading
1,Part']" /></xsl:variable>
<xsl:if test="$a">
<chapter>
<xsl:value-of select="$a"/>
</chapter>
</xsl:if>
</xsl:template>



 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.