XSL output method text including whitespaces in xsl

前端 未结 2 978
悲哀的现实
悲哀的现实 2021-01-14 06:00

I am creating some xsl to transform my xml into text (which will be csv eventually). I am using VS2008. When I use the editor to create the xsl, the transformed output is

2条回答
  •  借酒劲吻你
    2021-01-14 06:09

    The XSLT processor strips white-space text nodes in the template only between XSLT elements.

    So, in

     
       
    
    

    the xsl:for-each element has two white-space text child nodes: One after xsl:value-of, which is stripped; the other before the CDATA section, which is not stripped.

    Bottom line: Use xsl:text elements.

     
      
       
    
    

提交回复
热议问题