I am a bit new to XSLT stuff. The problem is that I need to get rid of whitespaces within certain elements in my input XML. For example
Hope, this will help you.
<xsl:template match="text()">
<xsl:value-of select="fn:normalize-space()"/> <!-- fn is the prefix bound to xpath functions -->
</xsl:template>
What you like to do is an Identity transform.
Try something like this:
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="normalize-space()"/>
</xsl:template>
</xsl:stylesheet>