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
Mike SappSubject: Grouping Problem still
Author: Mike Sapp
Date: 08 Apr 2008 02:24 AM
Originally Posted: 07 Apr 2008 07:32 PM
Hi

Im still having some trouble with a grouping problem. I can get the conversion to sum up the royalty, amount and fee elements of rows which are following rows which contain the type element titled 'RELEASE', however the grouping is adding the royalty, amount and fee elements of ALL rows.. Im trying to only have the royalty, amount and fee elements for rows which are immediately following a row which contains the type element 'RELEASE' and have the same order and releaseid as the preceding element which has the type 'RELEASE'. Otherwise i do not wish to have the rows grouped and only wish to have the rows data copied to a new row..

Looking forward to your reply and thank you for any assistance you can provide-


UnknownInput(11).xml
input file

UnknownAdditionOfRoyaltiesforReleases(1).xsl

Postnext
James DurningSubject: Grouping Problem still
Author: James Durning
Date: 08 Apr 2008 12:30 PM
You probably need to add a check somewhere like:

<xsl:if test="preceding-sibling::row[1][type='RELEASE']">
...

Postnext
Mike SappSubject: Grouping Problem still
Author: Mike Sapp
Date: 10 Apr 2008 09:51 PM
Hi James,

Ive been trying your suggestion for the last 3 days and i cant seem to get the results right. Ive tried using <xsl:if test="preceding-sibling::row[1][type='RELEASE']"> before the price, royalty, fee, amount, mechanicals, taxes elements but its not working.

Can you give me a better example of where to include the if:test?

Postnext
James DurningSubject: Grouping Problem still
Author: James Durning
Date: 11 Apr 2008 01:11 PM
<xsl:if test="...">
<fee>
...
</fee>
<amount>
...
</amount>
<royalty>
..
</royalty>
</xsl:if>

Postnext
Mike SappSubject: Grouping Problem still
Author: Mike Sapp
Date: 13 Apr 2008 08:49 PM
Originally Posted: 12 Apr 2008 01:07 AM
Hi James,

Im still having trouble with the Xpath for having the royalty, mechanicals, tax & expense sums be the total of more than just the first immediately following rows data. I cant seem to get the amounts to add for ALL of the immediately following rows with the same <releaseid> and <order> as the preceding-sibling::row[type='RELEASE'][1] row.

Im quite new to xslt and i honestly dont know how to proceed.


UnknownRoyaltyAddition.xsl

Posttop
Mike SappSubject: Grouping Problem still
Author: Mike Sapp
Date: 15 Apr 2008 10:54 PM
Originally Posted: 15 Apr 2008 10:52 PM
Im still having trouble with this.. how can i get it to group all of the immediately following rows with the same order number & releaseid as the precedingrow which contains the type='RELEASE'. I cant get a workaround past the first following row after the type='RELEASE'row... Please help me

 
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.