请教一下我用XSL转换XML的时候(通过服务器端)出现下面的情况XSL <xsl:element  name="a">
    <xsl:attribute name="onclick">GotoApp('<xsl:value-of select="ProjectURL" />');</xsl:attribute>
    <xsl:attribute name="style">
   cursor:corsor
  </xsl:attribute>
    <xsl:attribute name="href">
   javascript:void()
  </xsl:attribute>
被转换的结果
<a onclick="GotoApp('abc');" style="&#xD;&#xA;   cursor:corsor&#xD;&#xA;  " href="&#xD;&#xA;   javascript:void()&#xD;&#xA; "><image src="ICO/Interface_ICO_YJYA.gif" srcSource="ICO/Interface_ICO_YJYA.gif" border="0" alt="应急预案图片" style="&#xD;&#xA;   怎么出现了 &#xD;&#xA;这样的字符啊,出现这些特殊字符是在XSL文件中,而不是XML文件中
怎么去掉这些东西啊 
  

解决方案 »

  1.   

    是空白字符  <xsl:attribute name="style">
       cursor:corsor
      </xsl:attribute>要先去掉空白再转换
      

  2.   

    回车符(#xD)
    换行符(#xA)关于去除这些字符的方法见:
    http://www.ibm.com/developerworks/cn/xml/tips/x-tipwhitesp/index.html
      

  3.   

    以上是解决XML文档中的空白,问题是XSLT中的回车换行怎么解决?