因此,我有一个样式表,它大部分时间都在将元素从“命名空间 a”转换为 xhtml 命名空间。
然而,在一种特殊情况下,我希望允许输入词汇表包含任何 xhtml 元素。从模式的角度来看,我<xs:any namespace="...."/>
为 xhtml 命名空间添加了一个。
看起来像:
<btml:html-noscript xmlns="http://www.w3.org/1999/xhtml">
<div style="display:inline;">
<img height="1"
width="1"
style="border-style:none;"
alt=""
src="http://www.googleadservices.com/pagead/conversion/1070015830/?label=FoKlCKDxiAIQ1sqc_gM&guid=ON&script=0"/>
</div>
</btml:html-noscript>
样式表用于xsl:copy-of
将 passthrough 元素的子元素复制到输出中。
我正在使用的 Saxon-B(最新版本)似乎对命名空间有点愚蠢。尽管整个输出文档的目标命名空间是 xhtml 命名空间,但输出看起来像:
<noscript>
<div xmlns:btml="http://www.basistech.com/2010/btml/"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
style="display:inline;">
<img height="1"
width="1"
style="border-style:none;"
alt=""
src="http://www.googleadservices.com/pagead/conversion/1070015830/?label=FoKlCKDxiAIQ1sqc_gM&guid=ON&script=0"></img>
</div>
</noscript>
注意无意义的前缀,而不是仅仅放出<div ...>
. 请注意,整个业务的文档元素 ('html') 定义了xmlns="ttp://www.w3.org/1999/xhtml"
.
有什么办法可以整理一下吗?