title: XSLT : copy adds extra spaces around CDATA
body: <p>I am trying to process an xml file specific for an application. When I try to copy source xml as it is in output I figured out that processor adds spaces and new lines around CDATA.</p>
  
  <p>Do you know any way to avoid this ? I want to edit some values but need to clarify this issue.</p>
  
  <p>Here is the source xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;Application&gt;
    &lt;name&gt;&lt;![CDATA[Flow1]]&gt;&lt;/name&gt;
    &lt;versionInfo&gt;&lt;![CDATA[572573
  572573
  619888]]&gt;&lt;/versionInfo&gt;
    &lt;configUser&gt;&lt;![CDATA[USER1]]&gt;&lt;/configUser&gt;
    &lt;protected&gt;0&lt;/protected&gt;
    &lt;productRevision&gt;
      &lt;productNumber&gt;&lt;![CDATA[CER]]&gt;&lt;/productNumber&gt;
      &lt;revision&gt;&lt;![CDATA[DER]]&gt;&lt;/revision&gt;
    &lt;/productRevision&gt;
  &lt;/Application&gt;
  </code></pre>
  
  <p>Here is the xsl file I use:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:strip-space elements="/Application/name" /&gt;
      &lt;xsl:template match="@*|node()"&gt;
              &lt;xsl:copy&gt;
                  &lt;xsl:apply-templates select="@*|node()"/&gt;
              &lt;/xsl:copy&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>And here is the output:</p>
  
  <pre><code>&lt;Application&gt;
     &lt;name&gt;      &lt;![CDATA[Flow1]]&gt;
  
     &lt;/name&gt;
     &lt;versionInfo&gt;      &lt;![CDATA[572573
  572573
  619888]]&gt;
  
     &lt;/versionInfo&gt;
     &lt;configUser&gt;      &lt;![CDATA[USER1]]&gt;
  
     &lt;/configUser&gt;
     &lt;protected&gt;0&lt;/protected&gt;
     &lt;productRevision&gt;
        &lt;productNumber&gt;         &lt;![CDATA[CER]]&gt;
  
        &lt;/productNumber&gt;
        &lt;revision&gt;         &lt;![CDATA[DER]]&gt;
  
        &lt;/revision&gt;
     &lt;/productRevision&gt;
  &lt;/Application&gt;
  </code></pre>
  
  <p>Thanks</p>