xsl count descendants,xslt count descendants,counting descendants xslt,joshua gough,count xslt descendants,xslt count union, xml%%%xsl count descendants - Re: Union and descendants: count(.//name1

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

Re: Union and descendants: count(.//name1|name2) ? Doesn't p

Subject: Re: Union and descendants: count(.//name1|name2) ? Doesn't perform Union?
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 12 Jul 1999 17:53:56 -0700
xsl count descendants
At 99/07/12 19:13 -0400, Joshua Gough wrote:
>For example:
>
>count(.//entry|e) 
>
>Returns only the number of "entry" elements without adding the number of e
>matches to the result. 

Right ... probably because you don't have any 'e' children.

>Similarly,
>
>count(.//e|entry) 
>
>returns the number of e.

Right ... probably because you don't have any 'entry' children.

>However:
>
>count(./e|entry) 
>
>Works fine ... contains ... children.

As it should.

>But, I still figure the | operator should work. Can someone explain why
>this is not so?

Because the union operator separates the entire expression into
subexpressions and the context node for beginning the evaluation of each
subexpression is the current node.

You need (whitespace optional):   count( .//entry | .//e )

I hope this helps.

......... Ken


--
G. Ken Holman                    mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.             http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0   +1(613)489-0999   (Fax:-0995)
Website:  XSL/XML/DSSSL/SGML services, training, libraries, products.
Publications:   Introduction to XSLT (3rd Edition) ISBN 1-894049-00-4
Next instructor-led training:   MS'99 1999-08-16  MT'99 1999-12-05/06


 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.