在XSL中引用自身数据的两种方法
来源: 编辑:duliying 更新日期:2008-5-26 16:59:23 浏览:450 次
在XSL中引用自身数据的两种方法,如果你使用Msxml解析器,你可以用方法二:
方法一
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:mxh="http://xml.sz.luohuedu.net/">
<xsl:template match="/">
<mxh:Root>
<Line Val="1"/>
<Line Val="2"/>
<Line Val="3"/>
</mxh:Root>
<xsl:for-each select="document(‘‘)/xsl:stylesheet/xsl:template/mxh:Root/Line">
<xsl:value-of select="@Val"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
方法二
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:template match="/">
<xsl:variable name="Array">
<Root>
<Line Val="1"
第1页/总2页
第一页 上一页
下一页 最后一页
【发表评论】