xsl-list
[Top] [All Lists]

XSLT conditional sorting problem

2003-11-11 01:03:50
Hello,

I'm attempting to use XSLT (via PHP and Sablotron) to transform an XML music 
list into XHTML. I have it mostly working, but have come across some more 
complex issues that I'm unable to solve.

The XSL transforms an XML music list into nested XHTML lists, sorting the 
output by albums. Problems arise when albums that have multiple artists are 
encountered, as I am unable to correctly determine how to handle these.

Currently I'm outputting data as such:

Artist - Album_1
        Song_1
        Song_2
        ...
Artist - Album_2
        Song_1
        ...
...

When I encounter an album by various artists, I'd like to handle it as below, 
but was unable to figure out how to correctly do this:

"Various Artists" - Album_1
        Artist - Song_1
        Artist - Song-2
        ...


An example best explains what I'm trying to do. The current transformation can 
be viewed at http://the-i.org/music-albums that also contains links to both the 
XSLT style sheet and XML data. My problem is explained in more detail on that 
page so I won't repeat it here.

One additional thing, if anyone's feeling particularly intelligent and helpful 
- I would be interested to see how I'd sort my XML data into nested lists on 
both artist and album, as such:

Artist_1
        Album_1
                Song_1
                Song_2
                ...
        Album_2
        ...
Artist_2
...

Thanks for any help. 

Printed on 100% recycled electrons.
http://nedmartin.org/




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>