I am working with XSL
version 3.0.
How to highlight multiple targets in a same HTML
page? For example:
First I have the TEI
content to look to attribute value:
<ref n="1" target="#target1 #target2 #target3">some text</ref>
The related XSL
<xsl:template match="ref">
<a href="{ref/@target}" id="{@xml:id}"><xsl:value-of select="ref[@n]"/></a>
</xsl:template>
Then, I am looking to these @xml:id
values in TEI
<!-- target in @xml:id attribute -->
<l xml:id="target1">text A</l>
<l xml:id="target2">text B</l>
<l xml:id="target3">text C</l>
and the related XSL
<xsl:template match="l[@n]">
<li><xsl:apply-templates/><!-- from previous element -->
<sup><a href="{@xml:id}" name="{@xml:id}" id="line" ><xsl:value-of select="@n"/></a><sup>
</li>
</xsl:template>
I'm looking to display in HTML
:
<li>some text...<sup><a href="target1" name="target1" id="line">text A</a></sup></li>
<!--- other <li> -->
<!--- other <li> -->
<li>some text...textual content<sup><a href="target2" name="target2" id="line">text B</a></sup></li>
<!--- other <li> -->
<li>some text...textual content<sup><a href="target3" name="target3" id="line">text C</a></sup></li>
Each target is highlighted with CSS
(a#line:focus
). So, I would like to highlight all referenced targets in <a>
when I click on the link.
Is it possible?
In advance, thank you.