I want to create a heading in my PDF report using my xsl file. If the source file contains a hyperlink then it should render it as hyperlink, otherwise as plain text.
For example, my xml looks like:
<a href='http://google.com' target='_blank'>This is the heading </a>"
It should display a hyperlink if there is one, otherwise display the heading as plain text. How can I do that?
I am not able to use the below code under otherwise tag , please see below
<xsl:choose>
<xsl:when test="($RTL='true') or ($RTL='True')">
<fo:block wrap-option="wrap" hyphenate="true" text-align="right" font-weight="bold">
<xsl:value-of select="@friendlyname" />
</fo:block>
</xsl:when>
<xsl:otherwise>
<!--<fo:block wrap-option="wrap" hyphenate="true" font-weight="bold">-->
<xsl:template match="a">
<fo:block>
<xsl:choose>
<xsl:when test="@href">
<fo:basic-link>
<xsl:attribute name="external-destination">
<xsl:value-of select="@href"/>
</xsl:attribute>
<xsl:value-of select="@friendlyname" />
</fo:basic-link>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@friendlyname" />
</xsl:otherwise>
</xsl:choose>
</fo:block>
</xsl:template>
<!--<xsl:value-of select="@friendlyname" />-->
<!--</fo:block>-->
</xsl:otherwise>
</xsl:choose>
</xsl:if>
How can I use it there?