Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 6th, 2006, 03:05 AM
Authorized User
Join Date: Jul 2006
Location: Valencia, Valencia, Spain.
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default counting child nodes


     I'm working in a xslt file that has to count the number of child nodes of an specific parent node.I've been looking at the function
"count" but I don´t know how to call it.


  <b> </b>
  <b> </b>
  <b> </b>

Output 3

<xsl:template match="a">

<xsl:value-of select="count(child::b)"/>????????


Thanks for the help.


Reply With Quote
  #2 (permalink)  
Old September 6th, 2006, 03:26 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts

Your code looks fine.

Michael Kay
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting Child Records BrianWren VB Databases Basics 1 June 2nd, 2008 04:32 PM
Counting Nodes That Are Not Empty tommyready XSLT 2 September 4th, 2007 09:03 AM
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

All times are GMT -4. The time now is 02:21 AM.

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