jdom关于xsl:number的bug?
xml文档:
<?xml version="1.0"?>
<a>
<b>
<c>
<b/>
</c>
</b>
</a>
stylesheet:
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="a">
<xsl:apply-templates/><br/>
</xsl:template>
<xsl:template match="a/b">
<xsl:number format="1.1"/>b<br/>
<ul><xsl:apply-templates/></ul>
</xsl:template>
<xsl:template match="c">
<xsl:number format="1.1"/>c<br/>
<ul><xsl:apply-templates/></ul>
</xsl:template>
<xsl:template match="c/b">
<xsl:number format="1.1"/>b<br/>
<ul><xsl:apply-templates/></ul>
</xsl:template>
</xsl:stylesheet>
我希望解析出来的结果如下
1b
1c
1b
但是我用jdom读入xsl解析xml,成了这样子:
1b
1c
2b
如果在xml中指定xsl,用ie显示又是正常的
有谁知道这个bug到底发生在什么地方么?我看jdom的代码,有import javax.xml.transform.*;
但是我现在找不到这个的源码,有谁知道到哪里去找这个源码么?
还有,有没有什么办法避开这个bug?
谢谢了!
<?xml version="1.0"?>
<a>
<b>
<c>
<b/>
</c>
</b>
</a>
stylesheet:
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="a">
<xsl:apply-templates/><br/>
</xsl:template>
<xsl:template match="a/b">
<xsl:number format="1.1"/>b<br/>
<ul><xsl:apply-templates/></ul>
</xsl:template>
<xsl:template match="c">
<xsl:number format="1.1"/>c<br/>
<ul><xsl:apply-templates/></ul>
</xsl:template>
<xsl:template match="c/b">
<xsl:number format="1.1"/>b<br/>
<ul><xsl:apply-templates/></ul>
</xsl:template>
</xsl:stylesheet>
我希望解析出来的结果如下
1b
1c
1b
但是我用jdom读入xsl解析xml,成了这样子:
1b
1c
2b
如果在xml中指定xsl,用ie显示又是正常的
有谁知道这个bug到底发生在什么地方么?我看jdom的代码,有import javax.xml.transform.*;
但是我现在找不到这个的源码,有谁知道到哪里去找这个源码么?
还有,有没有什么办法避开这个bug?
谢谢了!
...全文
相关推荐
XML_XSL_DTD_SCHEMA_SAX_DOM_JDOM_WEBSERVICE简介.pdf
(如XSL、DTD、Schema、SAX、DOM、JDOM以及Web服务)在现代信息技术中扮演着至关重要的角色。
JDom使用详解.doc
= new ProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"test.xsl\""); doc.addContent
xml,sax,jdom,dom4j完全讲解
Schema是XML格式的,可以自定义数据类型,且所有Schema文档的根元素必须是`<xs:schema>`。
JDOM 帮助文档!
**转换(Transformations)**:JDOM与XSLT(XSL Transformations)结合,可以实现XML文档之间的转换。
jdom_student.rar_XML通讯录_java通讯录 xml
为了将XML数据以更直观的方式展示,项目提供了两种转换方式:XLS(Excel)和HTML。1.


