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

Re: Figuring out for-group-by

Subject: Re: Figuring out for-group-by
From: Barry Lay <blay@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 09 Jul 2004 18:44:23 -0400
barry tennison
Jeni,

Thanks. I didn't explain what I was going to do next. There's more to the input XML - it also contains playlists which refer to the tracks in the master list by Id, and which were not updated by the original conversion process to point to the new versions of the tracks. If I just remove the old tracks the playlists will be orphaned. I need to create a list of old-Id-to-new-Id maps to fix the playlists, then I can get rid of the extras. I also want to create a shell script to blow away the old audio files as they are taking up a lot of disk space.

What I thought to do was to group the tracks by the natural key so that I would have the old Ids and new Ids in one spot. The XSL I included was mainly to get used to for-each-group which I have never used. I was initially surprised by the result of

<xsl:value-of select="current-group()/key[string() = 'Track ID']/following-sibling::integer[1]"/>

which gives me all of the Ids for the dict elements that match the key. This gives me the old Ids as well as the new Ids. I thought that once I pick a new Id based on the 'Kind' (any of the lossless ones will do since they are identical) I could just use for-each to create elements that map the old to new and use that in subsequent processing.

Barry

Jeni Tennison wrote:

But I suggest that you only select (and group) the <dict> elements
whose Kind is 'Apple Lossless audio file' rather than filtering the
others out after going to the effort of grouping them.
Cheers,


Jeni

---
Jeni Tennison
http://www.jenitennison.com/

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.