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

Re: Query Regarding XSL

Subject: Re: Query Regarding XSL
From: Steve Tinney <stinney@xxxxxxxxxxxxx>
Date: Thu, 20 Jan 2000 07:14:22 -0500
pennsylvania xsl
You need the count() function, which takes a node-set as its argument. 
Something like count(Emp[@id='1']/*) will be what you want. For more
information see the XPath specification. 

Nilay.Shah@xxxxxxxxxxxxxxxxxxx wrote:
> Hello,
> I have created XML and want to apply XSL on that.  I want to is there a way
> to find the number of child a particular node has?
> For example suppose my XML looks like as follows:
> <company>
> <Emp id='1'>
>      <NAME>nilay</name>
>      <PSNO>1234</PSNO>
>      <SALARY>1000</SALARY>
>      <knowledge>C</knowledge>
>      <knowledge>C++</knowledge>
>      <knowledge>VB</knowledge>
>      <knowledge>Cobol</knowledge>
> </Emp>
> <Emp id = '2'>
>      <NAME>xyz</NAME>
>      <PSNO>3454</PSNO>
>      <SALARY>2121</SALARY>
>      <knowledge>C</knowledge>
>      <knowledge>C++</knowledge>
> </Emp>
> </company>
> Is there a way to find the count of nodes for Emp=1 and number of nodes for
> Emp=2?
>  The answer in first case should result in 7 while in second case should
> result in 5.
> Or is there a way to find the number of Employees?
> How should I do it in XSL?
> Please Reply,
> Thanks and Regards,
> Nilay.( XSL-List member)
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Steve Tinney                                        Babylonian Section
                                 *   University of Pennsylvania Museum
stinney@xxxxxxxxxxxxx                          Phila, PA. 215-898-4047

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.