newtfire / textEncoding-Hub

shared repo for DIGIT 110: Text Encoding class at Penn State Erie, The Behrend College
https://newtfire.github.io/textEncoding-Hub/
Creative Commons Zero v1.0 Universal
17 stars 1 forks source link

Alphabetical Order XSLT #29

Closed alexvanwoert closed 3 years ago

alexvanwoert commented 3 years ago

For the locations in the chapter I currently have:

This statement outputs at least 2/3 of the locations into alphabetical order with no repeats so I know the other functions are working correctly. The other 1/3 of the locations is definitely out of order at the end of the list because of the white spaces. I have tried:

and it stops outputting after Chapter 1 heading in the table. The problem is that normalize-space cannot handle more than one string like the other functions. When written without an inputted string as normalize-space() it uses the string value of the context node, in this case 'heading'.

This outputs the entire heading tag where I want the list of locations. Does anyone know how to use normalize-space in this context?

ebeshero commented 3 years ago

@alexvanwoert You’re on the right track here with identifying the problem. normalize-space() cannot take in a sequence of more than one. It needs to be run first, before the other functions, and it needs to run on just one node at a time. For this, use simple map ! rather than the arrow operator =>

alexvanwoert commented 3 years ago

Got it! Thanks.