2006-12-22

如何实现XML XSL javascript数据排序

来源: 本站收集整理 作者:冰河の泥鱼 评论 0 条
 

数据排序模版
<?xml version="1.0" encoding="gb2312" ?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="html" />
<xsl:param name="queryParam" select="''" />
<xsl:template match="/guestbook">
<table border="0">
<tbody>
<tr>
<td>
<table width="400" border="0">
<tbody>
<xsl:apply-templates select="article">
<xsl:sort select="datadate" order="descending" />
</xsl:apply-templates>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</xsl:template>
<!--文章列表模版:-->
<xsl:template match="article">
<xsl:choose>
<xsl:when test="position() mod 2 = 1">
<tr bgcolor="#cccccc">
<th align="left" width="50">作者</th>
<th align="left" width="50">
<xsl:value-of select="author" />
</th>
<th align="left" width="100">发表时间</th>
<th align="left" width="50">
<xsl:value-of select="datadate" />
</th>
</tr>
<tr bgcolor="#cccccc">
<td colspan="4">
<xsl:value-of select="content" />
</td>
</tr>
</xsl:when>
<xsl:otherwise>
<tr>
<th align="left" width="50">作者</th>
<th align="left" width="50">
<xsl:value-of select="author" />
</th>
<th align="left" width="100">发表时间</th>
<th align="left" width="50">
<xsl:value-of select="datadate" />
共2页: 上一页 1 [2] 下一页

(本文仅表明作者个人观点,不代表本站及其管理员立场.) 推荐 收藏 投稿 打印 返回 关闭
上一篇:使用PHP脚本修改Linux或Unix系统口令  
下一篇:PHP输出控制功能在简繁体转换中的应用
    评论加载中…
 推荐文章
     

网站首页  -  网站地图 -   站长论坛  -  网站投稿  -    -  网站管理
Copyright © 2008 芜湖站长站 All Rights Reserved 皖ICP备07500611号