Re: [xsl] Figuring out for-group-by

Subject: Re: [xsl] Figuring out for-group-by
From: Barry Lay <blay@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 09 Jul 2004 13:26:28 -0400
I am getting a little closer. I have managed to pull out more-or-less what I am after with

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

but I am concerned that the various keys may not always be in this order so the "preceding-sibling" search may not work. I can see that I can use for-each with current-group to iterate through the sets of keys so that may be more efficient than chasing up and down the tree.

Barry Lay wrote:

I am running into trouble doing a transform with for-group-by. I am currently running Saxon 7.9.1 and am in the process of upgrading to 8.0. I thought I would post what I am up to in case my approach is wrong.

I have an XML file that looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<key>Major Version</key><integer>1</integer>
<key>Minor Version</key><integer>1</integer>
<key>Application Version</key><string>4.6</string>
<key>Music Folder</key><string>file://localhost/Volumes/120%20GB/Music/iTunes/iTunes%20Music/</string>

   <key>Library Persistent ID</key><string>4AB531F8615308F0</string>
           <key>Track ID</key><integer>35</integer>
           <key>Name</key><string>Last Time</string>
           <key>Album</key><string>Something Like Human</string>
           <key>Kind</key><string>AIFF audio file</string>
            <!-- more key-value pairs -->
        <!-- more dict groups -->

Current Thread