line number in xml using xsl and html link
Hi All,
Im working for a XML files comparison report, generated in html. I get the output as same, different and new. i could get the line number of comparison using saxon:line-number, but I need to give this number as href in html and while this link is clicked in html report, then the actual line of error should be opened in xml. this is what im trying. i wrote a code but it does not go to the correct line but it just opens the xml file. can anyone help me please.
see the snippet below for "same":
<xsl:template mode="src1" match="TL1Commands">
<xsl:param name="tl1i"></xsl:param>
<xsl:param name="tl1cs"></xsl:param>
<xsl:variable name="tl1c" select="@cmdType"></xsl:variable>
<td><xsl:value-of select="$tl1c"/></td>
<td><xsl:value-of select="$tl1i"/></td>
<td>
<xsl:choose>
<xsl:when
test="$docB//TL1CommandSection[./Head=$tl1cs]//table[@tabType='TL1CmdImplementation']//tbody/row[.//TL1Commands=$tl1c]">
<xsl:choose>
<xsl:when
test="$docB//TL1CommandSection[./Head=$tl1cs]//table[@tabType='TL1CmdImplementation']//tbody/row[.//TL1Commands=$tl1c][.//TL1Instance=$tl1i]">
<a><xsl:attribute name="href"><xsl:value-of select="concat(document-uri($docA), '#', saxon:line-number())"></xsl:value-of></xsl:attribute>Same</a>
</xsl:when>
<xsl:otherwise>
<span class="diff">
<xsl:text>Different</xsl:text></span>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<span class="diff">
<xsl:text>New</xsl:text></span>
</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:choose>
<xsl:when
test="$docB//TL1CommandSection[./Head=$tl1cs]//table[@tabType='TL1CmdImplementation']//tbody/row[.//TL1Commands=$tl1c]">
<xsl:choose>
<xsl:when
test="$docB//TL1CommandSection[./Head=$tl1cs]//table[@tabType='TL1CmdImplementation']//tbody/row[.//TL1Commands=$tl1c][.//TL1Instance=$tl1i]">
<span class="same">"<xsl:value-of select="$tl1c"/>"</span> is present with Same instance
</xsl:when>
<xsl:otherwise>
<span class="diff">
"<xsl:value-of select="$tl1c"/>" is present with Different instance</span>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<span class="diff">
"<xsl:value-of select="$tl1c"/>" is totally New here</span>
</xsl:otherwise>
</xsl:choose>
</td>
</xsl:template>
regardsm
rummy
__________________
Rummy
|