-<xsl:template match="*[@xlink:href]">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:attribute name="xlink:href">
- <xsl:call-template name="makeURL">
- <xsl:with-param name="uri" select="@xlink:href"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:copy>
+<!-- Discharging content markup mantaining the linking info (helm:xref and
+xlink:href) -->
+<xsl:template match = "*" mode="semantics">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:if test="@xref">
+ <xsl:variable name="cnode" select="key('id',@xref)"/>
+ <xsl:if test="$cnode/@definitionURL">
+ <xsl:attribute name="xlink:href">
+ <xsl:call-template name="makeURL"><xsl:with-param name="uri" select="$cnode/@definitionURL"/></xsl:call-template>
+ </xsl:attribute>
+ <!-- xlink:show='other' requires the exact modality to be -->
+ <!-- specified in non-xlink markup. The point is that the -->
+ <!-- element is already MathML ==> we can't add other -->
+ <!-- markup without introducing another new namespace. -->
+ <!-- So, for now no markup is used. -->
+ <xsl:attribute name="xlink:show">other</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$cnode/@helm:xref">
+ <xsl:attribute name="helm:xref">
+ <xsl:value-of select="$cnode/@helm:xref"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:apply-templates mode="semantics"/>
+ </xsl:copy>