I have the following XSL transformation:
<xsl:for-each select="refsect1[@id = 'seealso']/para/citerefentry">
/// <seealso cref=""/>
<xsl:value-of select="refentrytitle" />
</xsl:for-each>
How can I place the value of refentrytitle in the cref attribute of the seealso tag in the template?
I don't understand how place the value of refentrytitle in the cref attribute of the seealso tag in the template.
Just put your expression within curly brackets (this is called Attribute Value Templates or simply AVT syntax) like this:
<seealso cref="{refentrytitle}"/>
You could do this:
<xsl:for-each select="refsect1[@id = 'seealso']/para/citerefentry">
/// <xsl:element name="seealso">
<xsl:attribute name="cref">
<xsl:value-of select="refentrytitle" />
</xsl:attribute>
</xsl:element>
</xsl:for-each>
Or you could probably just do this:
<xsl:for-each select="refsect1[@id = 'seealso']/para/citerefentry">
/// <seealso cref="{refentrytitle}" />
</xsl:for-each>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With