8,906
社区成员
发帖
与我相关
我的任务
分享
<?xml version="1.0" encoding="gb2312" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<xsl:for-each select="data/item">
<xsl:call-template name="item" />
</xsl:for-each>
</html>
</xsl:template>
<xsl:template name="item">xxx<xsl:value-of select="."/></xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="gb2312"?>
<?xml-stylesheet type="text/xsl" href="1.xsl"?>
<data>
<item>a</item>
<item>b</item>
<item>c</item>
</data>
<?xml version="1.0" encoding="gb2312" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<xsl:apply-templates select="data" mode="data"/>
</html>
</xsl:template>
<xsl:template mode="data" match="item">xxx<xsl:value-of select="."/></xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="gb2312" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<xsl:apply-templates select="recipes/item"/>
</html>
</xsl:template>
<xsl:template match="item">xxx<xsl:value-of select="."/></xsl:template>
</xsl:stylesheet>
[code=HTML]<?xml version="1.0" encoding="gb2312"?>
<?xml-stylesheet type="text/xsl" href="1.xsl"?>
<recipes>
<item id='1'>a</item>
<item id='2'>b</item>
<item id='3'>c</item>
</recipes>
[/code]<?xml version="1.0" encoding="gb2312" ?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> <xsl:template match="/">
<html>
<xsl:apply-templates select="recipes/item"/>
</html>
</xsl:template>
<xsl:template match="item">xxx<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="gb2312"?>
<recipes>
<item id='1'>a</item>
<item id='2'>b</item>
<item id='3'>c</item>
</recipes>
<?xml version="1.0" encoding="gb2312" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<xsl:apply-templates select="recipes/item"/>
</html>
</xsl:template>
<xsl:template match="item">xxx<xsl:value-of select="."/></xsl:template>
</xsl:stylesheet>
html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body onload="init();">
</body>
</html>
<script >
function init(){
//alert(parent.frames.length); alert(parent.frames[0].name); alert(parent.frames[1].name); alert(parent.frames[2].name);
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("1.xml")
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("1.xsl")
GuidContent.innerHTML = xml.transformNode(xsl);
}
</script>
<div id="GuidContent"></div>