I have the following xsl that sorts my xml alphabetically:
This question must be edited in order for anyone to understand what the problem really is. The comment by Tomalak reveals that the OP "wants lists of items in an alphabetically ordered grid. One list for each letter. Four letters horizontally, as much as it takes vertically"
The following transformation:
when applied on this XML document:
produces the wanted result:
A
Agenda
Accrual
Ads
Averages
B
Bindings
Budget
C
Cars
Categories
Costs
P
Policy
Politics
R
Reevaluations
Report
Do note three things:
We are using the (exslt) ext:node-set() extension function to convert an intermediate result from RTF (Result-Tree Fragment) to a temporary tree.
The
necessary to make the original XML document the current XML document again, so that the key() function will use the index made for this document and not for the temporary tree.
Each start letter that must start a new row of (4) starting letters is processed in a special template, in which the Here we have covered and demonstrated a few advanced XSLT techniques: Enjoy :) is produced. Then this and the remaining (3) starting letters in the row are processed within the body of the in "copy" mode, just creating a each.