<t>
<rendition xml:id="b">color: blue</rendition>
<rendition xml:id="r">color: red</rendition>
<tagUsage gi="p" render="b" />
<tagUsage gi="emph" render="r" />
</t>
How would I create an XSL 1.0 key into rendition elements based on @gi in the tagUsage element, joining rendition/@xml:id to tagUsage/@render? Something like
<xsl:key name="rendition-by-tagName"
match="rendition"
use="//tagUsage[@xml:id of rendition = @render of tagUsage]/@gi" />
so that given “p”, the key would return the blue rendition; given “emph”, the key would return the red rendition.
Use:
Here is a complete verification:
When this transformation is applied on the provided XML document:
the wanted, correct result is produced: