删除XSLT中的空行

Mat*_*t W 2 xml xslt whitespace

我正在使用:

<xsl:template match="material_id | location_code"></xsl:template>
Run Code Online (Sandbox Code Playgroud)

为了摆脱称为源XML元素material_idlocation_code,但空格线保持,留下输出XML是这样的:

<entries>
    <Identity>conflab1</Identity>


    <price>24.36</price>
    <pricedate>15-Jul-2010 13:35:18 UTC</price_date>
</entries>
Run Code Online (Sandbox Code Playgroud)

我应该如何阻止它留下换行符?

谢谢,

马特

hol*_*lsk 10

尝试:

<xsl:strip-space  elements="*"/>
Run Code Online (Sandbox Code Playgroud)

在文档的顶部.

  • 这将删除所有空白区域,即文档后面是一条巨大的长线.如何只删除原来问的空行? (3认同)