<xsl:template match="/set">
<xsl:value-of select="name"> <xsl:apply-templates select="descriptiom/position()=position()"/>
<xsl:apply-templates select="code/position()=position()"/>
</xsl:template><xsl:template match="description">
<xsl:value-of select="."/>
</xsl:template><xsl:template match="code">
<xsl:value-of select="."/>
</xsl:template>
其实,这样定义xml文件就省事多了
<set>
<setentry>
<name/>
<description/>
<code/>
</setentry>
</set>
当然,如果没有权限修改xml文件的定义就没办法了,呵呵
<xsl:value-of select="name"> <xsl:apply-templates select="descriptiom/position()=position()"/>
<xsl:apply-templates select="code/position()=position()"/>
</xsl:template><xsl:template match="description">
<xsl:value-of select="."/>
</xsl:template><xsl:template match="code">
<xsl:value-of select="."/>
</xsl:template>
其实,这样定义xml文件就省事多了
<set>
<setentry>
<name/>
<description/>
<code/>
</setentry>
</set>
当然,如果没有权限修改xml文件的定义就没办法了,呵呵
解决方案 »
- 知道有什么办法让java持久化类生成hbm.xml文件吗
- 随机产生10个数1到99之间,然后输出10个数中最大的数和最的小数?
- java通过jacob创建word文档中遇到的问题
- 有一万条数据需要插入数据库,各位高手给点提示吧!
- 谁能给一个SSO的解决方案?开源框架的最好
- hibernate not-null property references a null or transient value
- 以jboss作服务器处理JMS消息队列,可以发送却不能接受消息,大家帮我看看哈
- Hibernate初学之可运行的实例(SqlServer版)
- 有谁有mysql jdbc的驱动程序,发我一份!!
- tomcat :为什么我的http://localhost:8080 显示jsp实例?而不是欢迎界面?
- j2ee服务器启动失败!
- jbuild7为何不能直接通过jdbc连上sql server7?
<xsl:template match="/set">
<xsl:for-each select="name">
<xsl:value-of select="."/> |
<xsl:variable name="pos" select="position()"/>
<xsl:apply-templates select="/set/description[position()=$pos]"/> |
<xsl:apply-templates select="/set/code[position()=$pos]"/><br/>
</xsl:for-each>
</xsl:template><xsl:template match="//description">
<xsl:value-of select="."/>
</xsl:template><xsl:template match="//code">
<xsl:value-of select="."/>
</xsl:template>