XSL到XML生成中的命名空间问题
我使用SAXON生成XML,但是namepspaces会附加生成的XMLXSL到XML生成中的命名空间问题,xml,xslt,saxon,Xml,Xslt,Saxon,我使用SAXON生成XML,但是namepspaces会附加生成的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:/
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>
XSL-->
.........
(使用Saxon扩展函数)
xsl:value of select=“ext:fooofunction(“someValue”)”/>
生成的输出是
<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>
新泽西州
12.99%
我不希望名称空间出现在生成的xml中。或者它应该属于默认的XML名称空间,即
http://www.xfa.org/schema/xfa-data/1.0/
我想您只是想在xsl:stylesheet
元素上使用exclude result prefixes=“ext”
。现在我通常使用exclude result prefixes=“#all”作为样板。10次中有9次它能给你想要的。