XSLT得到一些不需要的值
XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE UploadXML SYSTEM "ex_v222.dtd">
<UploadXML><Version>1.1</Version>
<Properties>
<Property>
<IntegratorID>3232321</IntegratorID>
<IntegratorPropertyID>12312312-3</IntegratorPropertyID>
<IntegratorOfficeID>1231231231</IntegratorOfficeID>....
由于某种原因,以下XSL文件始终获取1.1值并将其放在信封元素之前:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:param name="Z">2312</xsl:param>
<xsl:param name="A">KKK</xsl:param>
<xsl:output method="xml" encoding="utf-8" indent="yes" />
<xsl:strip-space elements="*" />
<xsl:template match='/UploadXML/Properties'>
<Envelope>
<Body>
<add_adverts>
<xsl:apply-templates select='Property'/>
</add_adverts>
</Body>
</Envelope>
</xsl:template>
....(我相信模板实现并不重要..)
我得到的是:
<?xml version="1.0" encoding="utf-8"?>
1.1<Envelope xmlns:fo="http://www.w3.org/1999/XSL/Format">
<Body>
<add_adverts>
<advert>
。
。
。
看那1.1?为什么?
任何的想法?
没有找到相关结果
已邀请:
2 个回复
桔马牛
茶鬼失形
解决方案是为任何不应出现在输出中的文本节点覆盖此模板,该模板具有空主体(不执行任何操作,因此不会复制文本节点)。在这种情况下: