I'm trying to format a table from XML. Lets say I have this line in the XML
<country>Dominican Republic</country>
I would like to get my table to look like this
<td class="country DominicanRepublic">Dominican Republic</td>
I've tried this:
<td class="country {country}"><xsl:value-of select="country"/></td>
then this:
<xsl:element name="td">
<xsl:attribute name="class">
<xsl:text>country </xsl:text>
<xsl:value-of select="normalize-space(country)"/>
</xsl:attribute>
<xsl:value-of select="country"/>
</xsl:element>
The normalize-space()
doesn't remove the space between the two parts of the name and I can't use <xsl:strip-space elements="country"/>
because I need the space when I display the name inside the table cell.
How can I strip the space from the value inside the class, but not the text in the cell?