Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 4th, 2007, 08:15 AM
Registered User
 
Join Date: Sep 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Counting Nodes That Are Not Empty

Ok,

I'm trying to count all nodes that are not = NULL. I know how to count them all node
Code:
<xsl:variable name="QtyCount">
    <xsl:value-of select="count(Qty)" />
</xsl:variable>
But how do I count only the ones that have a value? I can't find an example on the net that works.

 
Old September 4th, 2007, 08:56 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

The following works...

Code:
count(Qty[text()])
/- Sam Judson : Wrox Technical Editor -/
 
Old September 4th, 2007, 09:03 AM
Registered User
 
Join Date: Sep 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks!! You rock!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting leaf nodes by transforming their value dmorin XSLT 3 June 29th, 2007 04:58 AM
Counting nodes on output bonekrusher XSLT 6 February 26th, 2007 08:19 PM
Using axis instead of count? Counting child nodes. dep XSLT 1 January 17th, 2007 11:27 AM
counting child nodes Tomi XSLT 1 September 6th, 2006 03:26 AM
Counting ?!? hcweb Classic ASP Basics 2 December 8th, 2003 05:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.