RJP43 / CitySlaveGirls

The Restoration of Nell Nelson
http://nelson.newtfire.org
5 stars 4 forks source link

Sorted SVG elements with xsl:sort over an Array of Variables #27

Closed ebeshero closed 8 years ago

ebeshero commented 8 years ago

@RJP43 @spadafour The solution to the question of how to sort wasn't too hard, but a little different from what we're used to. The <xsl:sort> does need to sit inside an apply-templates or an xsl:for-each, but if we stop and think about it, we can set up a for-each to loop through nothing else but the value of your list of eight variables for the various speaking voices in your collection. Using <xsl:for-each> here was the secret to reducing the total lines of code so you don't have to repeat so much. Inside it, I set a variable for stroke-color, too, and then I needed to only write one definition for an SVG element <line> and one for an SVG element <text>.

Here's a direct link to the XSLT file.