XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1126)
- Stylus Studio Technical Forum (13842)
-> + EDI XML Converters Inserting "... (2)
-> + Trying to use EDI to XSD docum... (4)
-> + Specifying EDI Delimiters (2)
-> + Defining 'connection string' f... (9)
-> + Help Programatically Convertin... (2)
-> + Using adapter URL in pipeline. (7)
-> + How to enable EDI functionalit... (2)
-> + Unable to open file with '%2F'... (2)
-> + How to create a dependency gra... (2)
-> + If block (2)
-> + Mapping multiple files within ... (7)
-> + StylusStudio vs Altova vs BizT... (4)
-> + Command line execution (7)
-> + CSS and Styling in X15 (2)
-> + Ignores debug breakpoints in X... (5)
-> + Cursor dissapearing in Text vi... (5)
-> + compile error xquery java styl... (3)
-> + Stylus Studio Setup: Applicati... (10)
-> + Stylus StudioX15 Crashing whe... (4)
-> + Upgrade Stylus 14 to 15 (2)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (244)
+ XSLT Help and Discussion (7447)
+ XQuery Help and Discussion (1870)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (361)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Mark MaltbySubject: Count on 2 node sets
Author: Mark Maltby
Date: 16 May 2006 10:57 AM
Is it possible to do a concatenative count on two sets of nodes?

Postnext
Minollo I.Subject: Count on 2 node sets
Author: Minollo I.
Date: 16 May 2006 11:18 AM
If I well understand what you mean, yes. You can do something like:

count(//seniorEngineer/@salary | //juniorEngineer/@salary)

...to compute the total of all salaries for both junior and senior engineers.

Postnext
Mark MaltbySubject: Count on 2 node sets
Author: Mark Maltby
Date: 16 May 2006 11:26 AM
<xsl:value-of select="count(Nodes/Node/x and Nodes/Node/y)"/>

Whilst tring to do the above i get a error:

Value of expression cannot be converted to a node-set in value-of

All i want to achieve is a count of when both x and y are both present

Postnext
Minollo I.Subject: Count on 2 node sets
Author: Minollo I.
Date: 16 May 2006 11:41 AM
Try
<xsl:value-of select="count(Nodes/Node/x | Nodes/Node/y)"/>

Postnext
Mark MaltbySubject: Count on 2 node sets
Author: Mark Maltby
Date: 16 May 2006 11:43 AM
isn't pipe "or"

Postnext
Tony LavinioSubject: Count on 2 node sets
Author: Tony Lavinio
Date: 16 May 2006 11:56 AM
Originally Posted: 16 May 2006 11:47 AM
Well, pipe is 'union'. It means to count any nodes that are in this set
or in that set. (That is, one or the other or both - it's kind of like
an or, but not quite.)

Postnext
Mark MaltbySubject: Count on 2 node sets
Author: Mark Maltby
Date: 16 May 2006 11:51 AM
And is what i need then. Please see my second message where I get the error

Postnext
Mark MaltbySubject: Count on 2 node sets
Author: Mark Maltby
Date: 16 May 2006 12:23 PM
if i have 2 'x' nodes and 4 'y' nodes i want my result to return 2 and not 4.

Is this possible?

Posttop
Minollo I.Subject: Count on 2 node sets
Author: Minollo I.
Date: 16 May 2006 12:57 PM
Running XSLT 2.0 or XQuery, you may be able to use "intersect": http://www.w3.org/TR/xpath20/#combining_seq

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.