The*_*nix 5 xml xslt xmlstarlet
XSLT XML 输出格式正在去除结束标记之前的空格
<Import Include="System.Web" />变成<Import Include="System.Web"/>
由于 XSLT 还删除了它所应用的文档中的许多节点,因此我想删除空格,但右斜杠除外。
xslt 被应用于许多 xml ms proj 文件
模板.xsl;
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ms="http://schemas.microsoft.com/developer/msbuild/2003">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<!--<xsl:preserve-space elements="text"/>-->
<xsl:template match='@*|node()'>
<xsl:copy>
<xsl:apply-templates select='@*|node()'/>
</xsl:copy>
</xsl:template>
...
...
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)