Hi,
We would like to remove the unwanted space which is generated after the locator attribute.
Input:
Code:
<index.level level="3"><name>Administration proposal to increase tax rate by 0.3 percent opposed, "decoupling" proposal accepted, text</name> <locator punct.before=" ">26:A-5</locator> <locator punct.before=", ">D-1</locator>
</index.level>
Xslt:
Code:
<!-- For Index-Level-->
<xsl:template match="index.level">
<xsl:choose>
<xsl:when test="@level='3'">
<xsl:element name="p"><xsl:attribute name="style">padding-left: 4em;</xsl:attribute>
<strong><xsl:text>â</xsl:text><font color ="DarkViolet">
<xsl:apply-templates/></font></strong>
</xsl:element>
</xsl:when>
<xsl:when test="@level='4'">
<xsl:element name="p"><xsl:attribute name="style">padding-left: 6em;</xsl:attribute><strong>ââ<font color ="MediumBlue">
<xsl:apply-templates/></font></strong>
</xsl:element>
</xsl:when>
</xsl:choose>
</xsl:template>
<!--For Locator-->
<xsl:template match="locator[@punct.before]">
<xsl:variable name="punct"><xsl:value-of select="@punct.before"/></xsl:variable><span style = "color:DarkSlateGray;"><span style = "color:DeepPink;"><xsl:value-of select="$punct"/></span><xsl:apply-templates/></span>
</xsl:template>
Output:
Code:
âAdministration proposal to increase tax rate by 0.3 percent opposed, "decoupling" proposal accepted, text 26:A-5 , D-1
In the above output, space comma(Red Color) should be comma i.e.,
26:A-5, D-1
Please advice for deleting unwanted space before the locator..
Thanks,