I have a servlet filter in my application that intercepts all the incoming requests and tries to strip the whitespaces from the incoming XML and write the resulting 'clean' XML to the response. I am using XSLT to achieve this. Please see the XSLT below:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" omit-xml-declaration="no" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
However, this is not working as expected. The resulting XML is the same as the original XML (despite of using the <xsl:strip-space elements="*"/> in the stylesheet.
Please help me getting this right.
Regards,
- Ashish