Hello,
I was under the impression that your question referred to displaying the XML in oXygen Author page so I gave an answer for that. My mistake. You are actually referring to the html output of an WebHelp transformation? If that is the case, you should probably intervene inside the XSL stylesheets used for WebHelp.
The template that processes XHREF is found in
{oxygenInstallDir}/frameworks/dita/DITA-OT/xsl/xslhtml/rel-links.xsl:
Code: Select all
<xsl:template match="*[contains(@class,' topic/xref ')]" name="topic.xref">
There are a lot of branches there, processing different types of XREFs, but for an XREF like
Code: Select all
<xref href="http://www.oxygenxml.com/forum/topic6490.html" format="html" scope="external"/>
it will go through line 77
Code: Select all
<xsl:when test="*[not(contains(@class,' topic/desc '))]|text()">
Following the
xref element presented above, to output just the last part of its href you could replace line 78:
Code: Select all
<xsl:apply-templates select="*[not(contains(@class,' topic/desc '))]|text()"/>
with:
Code: Select all
<xsl:call-template name="getHrefName">
<xsl:with-param name="href">
<xsl:apply-templates select="*[not(contains(@class,' topic/desc '))]|text()"/>
</xsl:with-param>
</xsl:call-template>
where the
getHrefName template should be declared like:
Code: Select all
<xsl:template name="getHrefName">
<xsl:param name="href"/>
<xsl:choose>
<xsl:when test="contains($href, '/')">
<xsl:call-template name="getHrefName">
<xsl:with-param name="href" select="substring-after($href, '/')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$href"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Template
getHrefName can be edited to obtain a different representation if required. Also, the same approach can be used on other branches (
<xsl:when) if needed.
Regards,
Alex