I'm a relative novice with XSLT, not having touched it since the late 90s, but I've recently started on a personal project that will involve it.
I have the following XML, from which I'm attempting to build an HTML character sheet:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="./Statblock.xslt"?>
<Character>
<Name value="Seiyatomo"/>
<Family value="Soshi"/>
<Clan value="Scorpion"/>
<School value="Soshi Illusionist School"/>
<Titles/>
<Ninjo value=""/>
<Giri value=""/>
<Abilities>
<Ability description="" name="The Kami's Whisper" />
</Abilities>
<Skills>
...
</Skills>
<Rings>
...
</Rings>
<Social glory="50" honor="35" status="35"/>
<Wealth bu="0" koku="6" zeni="0"/>
<Derived composure="8" endurance="4" focus="4" vigilance="3"/>
<RankStatus titlestatus="Title: , Title XP: 0" curricstatus="Rank: 1, XP in Rank: 0"/>
<Curriculum>
...
</Curriculum>
<Title/>
<Techniques>
<Technique name="Bō of Water" />
<Technique name="Cloak of Night" />
<Technique name="Token of Memory" />
<Technique name="Commune with the Spirits" />
<Technique name="All in Jest" />
<Technique name="Dangerous Allure" />
<Technique name="Shadowlands Taint (Water)" />
<Technique name="Curiosity" />
<Technique name="Dark Secret" />
<Technique name="Fallen Ancestor" />
</Techniques>
<PersonalTraits/>
<Equipment>
...
</Equipment>
<Heritage value="Glorious Sacrifice"/>
<Notes value="..."/>
<Advances/>
<TotalXP value="0"/>
<XPSpent value="0"/>
<Portrait base64image=""/>
</Character>
I am trying to group the combined list of Ability & Technique nodes into sets of 9, such that I'll get output akin to this:
<page>
<ability>The Kami's Whisper</ability>
<technique>Bō of Water</technique>
<technique>Cloak of Night</technique>
<technique>Token of Memory</technique>
<technique>Commune with the Spirits</technique>
<technique>All in Jest</technique>
<technique>Dangerous Allure</technique>
<technique>Shadowlands Taint (Water)</technique>
<technique>Curiosity</technique>
</page>
<page>
<technique>Dark Secret</technique>
<technique>Fallen Ancestor</technique>
</page>
The number of <Ability> and <Technique> nodes in the XML are arbitrary, but I would prefer that all <ability> nodes come first in the output, followed by the <technique> nodes.
Bonus points, if that last <page> can be full of empty <technique> entries to fill the page out to the full set of 9, but that's a secondary concern.
I tried searching for similar questions, but either I didn't see any that were quite like this, or I didn't understand the question/answers sufficiently to recognize them as duplicates.
Note: It may be possible to get the author of the application which generates the XML to make some changes to the XML if necessary, but I can't directly control the XML itself.