<% dim ModuleName,InfoID,ChannelShortName,CorrelativeArticle,InstallDir,ChannelDir,Keyword,PageTitle,ArticleIntro,Articlecontent Keyword=stripHTML("WEB,XML,应用,技巧") PageTitle=stripHTML("在XSL中实现项目列表的例子") ArticleIntro=stripHTML("") Articlecontent=stripHTML("    Test.xml              =======================================              <…") ModuleName = stripHTML("classical") InfoID = stripHTML("24828") ChannelShortName=stripHTML("文章") InstallDir=stripHTML("http://www.77169.com/") ChannelDir=stripHTML("classical") %> 在XSL中实现项目列表的例子 - 华盟网 - http://www.77169.com
您现在的位置: 华盟网 >> 知识库 >> WEB开发 >> XML >> 应用技巧 >> 正文

在XSL中实现项目列表的例子

2005/8/29 作者:孟宪会 来源: unknown
导读 <% if len(ArticleIntro)<3 then Response.Write Articlecontent 'Response.Write "Articlecontent" else Response.Write ArticleIntro 'Response.Write "ArticleIntro" end if %>
    Test.xml
=======================================

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<store>
<items>
<item>a</item>
<item>b</item>
<item>c</item>
</items>
<items>
<item>x</item>
<item>y</item>
<item>z</item>
</items>
</store>

 

test.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="items">
<h1>项目 : <xsl:number /></h1>
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="item">
<h3>
<xsl:number level="multiple" format="[1.1] " count="items | item"/>
<xsl:value-of select="."/>
</h3>
</xsl:template>

</xsl:stylesheet>