|
[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
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








