我正在转换云项目的服务配置文件。 我对XML命名空间知之甚少。 我正在使用MSBuild来执行XslTransformation任务。 我得到了一个不需要的xmlns =""。如何从输出中删除它?
提前致谢!
XSLT文件: -
toLocaleDateString()
输入XML文件: -
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:t="http://schemas.microsoft.com/ServiceHosting/2008/10/XXXX" exclude-
result-prefixes="t">
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="//t:Setting[@name='EnableI18NTesting']">
<Setting name="EnableI18NTesting" value="False"></Setting>
</xsl:template>
</xsl:stylesheet>
输出XML文件: -
<?xml version="1.0" encoding="utf-8"?><ServiceConfiguration
serviceName="AppService" osFamily="4" osVersion="*" schemaVersion="2015-
04.2.6"
xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/XXXX">
<Role name="AppServices">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="EnableI18NTesting" value="True" />
</ConfigurationSettings>
</Role>
</ServiceConfiguration>