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
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Cart ChiuSubject: number (count) of unique groups - ATTACHMENTS ADDED
Author: Cart Chiu
Date: 01 May 2007 01:38 PM
Originally Posted: 01 May 2007 09:32 AM
Hi all,

This site has been great! I have been able to solve my multi-level grouping problem thanks to this site. I am almost finished my transformation but encountered one last snag.

Attached are the input, XSLT transformation file and the output file.

Basically, the XSL transformation groups (batches) together EFTRecords that have the same values for dueDate and description elements (2-level grouping). This part works OK.

The last part of the transformation, FileTrailer needs to sum up the number of unique groups (batches) in the transformed (output) XML. See HELP above (The batchCount child element of FileTrailer). The correct answer is 2 in this case. I have tried count($unique-batches) but that does not work.

Thanks in advance
Cart


Documentinput_small.xml
Input File

Documentstylesheet_small.xsl
Stylesheet

Documentoutput_small(2).xml
Output

Postnext
Ivan PedruzziSubject: number (count) of unique groups - ATTACHMENTS ADDED
Author: Ivan Pedruzzi
Date: 01 May 2007 05:25 PM
Hi Cart,

From our records you don't appear to be an active Stylus Studio user. Could you please send your Stylus Studio installation ID to stylus-field-report@progress.com?

Thank you
Ivan Pedruzzi
Stylus Studio Team

Postnext
Elias HuterSubject: number (count) of unique groups - ATTACHMENTS ADDED
Author: Elias Huter
Date: 04 May 2007 05:20 AM
Hi Chiu,

try to insert:

<xsl:variable name="counter" select="position()"/>

after the <Batch> tag in your XSLT sheet. It should say "2", as requested, in the end:

<FileTrailer>
<detailCount>
<xsl:value-of select="$counter"/>
</detailCount>
</FileTrailer>

Regards
Elias

Postnext
Cart ChiuSubject: number (count) of unique groups - ATTACHMENTS ADDED
Author: Cart Chiu
Date: 04 May 2007 02:13 PM
Hi,

Sorry, I didn't know I needed a stylus studio license to use this forum.

Thanks for your response Elias. Unfortunately, it didn't seem to work. Any ideas? It always returns 1 irregardless of how many batches / groups I have.

Thanks.

Posttop
Elias HuterSubject: number (count) of unique groups - ATTACHMENTS ADDED
Author: Elias Huter
Date: 07 May 2007 03:19 AM
Maybe you got something wrong, i downloaded your files and tested them with the "position()" function and it worked.

I'll attach my XSL file so you can try it yourself.


Documentstylesheet_new.xsl

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
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-2016 All Rights Reserved.