Hi,
I'm using Xsl transformation to display an Xml data as Html.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:util="urn:the-xml-files:xslt">
<xsl:output method="xml" indent="yes"
omit-xml-declaration="yes" encoding="utf-8"/>
<xsl:template match="/">
<xsl:for-each select="/Categories/Category">
<li class="c">
<a class="d">
<xsl:attribute name="id">cat_<xsl:value-of select="categoryid"/></xsl:attribute>
</a>
</li>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
If the li element's id attribute's select is not in one line, the XSL processor will fill up the attribute value with whitespace, which totally breaks the javascript on the front end.
Of course, Visual Studio will always reformat many-definitions-in-one-line, so if I change something, I need to remove the whitespace manually.
How can I remove unnecessary whitespace from an element? Should I do an xsl:copy with xsl:strip-space, or is there any better solutions? :)