XSL到XML生成中的命名空间问题

时间:2018-08-23 06:25:54

标签: xml xslt saxon

我正在使用SAXON生成XML,但是将命名空间附加到生成的xml上

XSL --> 
<?xml version = "1.0" encoding = "UTF-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.xfa.org/schema/xfa-data/1.0/" 
xmlns:ext="http://myorg.com">.........
<ELEM>
     <xsl:value-of select="$application/ELEM" />
 </ELEM>
<LINE_4> ( Using Saxon Extension Function )
   xsl:value-of select="ext:FooFunction("someValue")" />
</LINE_4>

生成的输出是

<ELEM xmlns="http://www.xfa.org/schema/xfa-data/1.0/" xmlns:ext="http://myorg.com">NEW JERSEY</ELEM>
<LINE_4 
xmlns="http://www.xfa.org/schema/xfa-data/1.0/" xmlns:ext="http://myorg.com">12.99%
</LINE_4>

我不希望名称空间出现在生成的xml中。或者它应该属于http://www.xfa.org/schema/xfa-data/1.0/

的默认XML名称空间。

1 个答案:

答案 0 :(得分:1)

我认为您只是想在exclude-result-prefixes="ext"元素上使用xsl:stylesheet

相关问题