现在的位置: 首页 > 综合 > 正文

index.xsl中包含head.xsl,bottom.xsl

2012年03月05日 ⁄ 综合 ⁄ 共 918字 ⁄ 字号 评论关闭

index.xsl
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html>
<head>
<title>index</title>
</head>
<body>
<div id="head"><xsl:copy-of select="document('head.xsl')"/></div>
<div id="mainbox"><xsl:value-of select="content"/></div>
<div id="bottom"><xsl:copy-of select="document('head.xsl')"/></div>
<div></div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

head.xsl
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
Head
</xsl:template>
</xsl:stylesheet>

bottom.xsl
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
Bottom
</xsl:template>
</xsl:stylesheet>

Index.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="index.xsl"?>
<content>body body body</content>

抱歉!评论已关闭.