实际是XSLT 的解析脚本,在IE和FireFox 中都可以良好的运行!

源代码

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:function="http://www.infopro.cn/epservernamespace"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
>
<xsl:template match="/">
<html>
<head>
<!--"""
StatCVS 分析结果XML 快速XSLT模板
Zoomq::041227 使用 CSS+JS 进行点击支持
$Id: weeklystat.xsl,v 1.5 2005/01/04 10:34:45 zhouqi Exp $
"""-->
<title>新浪·研发·邮件-CVS周活动统计 @ FreeBSD+Python+XML</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="sinaeye.ico" rel="shortcut icon" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script language="JavaScript" > 
//o=document.getElementById('xxx');o.style.display=o.style.display=='none' ? '' : 'none'
function _showDIV(divID){
    var _obj = document.getElementById(divID);
    //alert(divID+"\n"+_obj);
    _obj.style.display = (_obj.style.display=='none')? '' : 'none';    
    return;
}
</script>
</head>
<body  leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<xsl:for-each select="root">
<xsl:for-each select="week">
<h1 style="cursor : hand">
    <xsl:attribute name="onclick">
    _showDIV("stat-<xsl:value-of select="@date" />");
    </xsl:attribute>
CVS活动周分析 截止日期<xsl:value-of select="@date" />
</h1>
<ul>
    <li>总更新文件数:   <xsl:value-of select="@files" />
        </li>
    <li>总提交修改数:   <xsl:value-of select="@commits" />
        </li>
    <li>总涉及码行数:   <xsl:value-of select="@lines" />
        </li>
    <li>
    <div style="border : 1px dotted #ede;
                display : none;">
            <xsl:attribute name="id">stat-<xsl:value-of select="@date" /></xsl:attribute>
    <ul>
    <xsl:for-each select="cvs">
    <h3 style="cursor : hand">
    <xsl:attribute name="onclick">
    _showDIV("cvs-<xsl:value-of select="../@date" />-<xsl:value-of select="@name" />");
    //alert("cvs-<xsl:value-of select="@name" />");
    </xsl:attribute>
    <xsl:value-of select="@name" /> 库 中:</h3>
    <li>总更新文件数:   <xsl:value-of select="@files" />
        </li>
    <li>总提交修改数:   <xsl:value-of select="@commits" />
        </li>
    <li>总涉及码行数:   <xsl:value-of select="@lines" />
    </li>
    <li>
        <ul>
        <div style="border : 0px dotted #993300;
            display : none;
            background-color : #336699;
            color:#fff;">
        <xsl:attribute name="id">cvs-<xsl:value-of select="../@date" />-<xsl:value-of select="@name" /></xsl:attribute>
        <xsl:for-each select="module">
        <h5>模块 <xsl:value-of select="@name" /> 更新细节:</h5>
            <li>更新文件数:   <xsl:value-of select="@files" />
                </li>
            <li>提交修改数:   <xsl:value-of select="@commits" />
                </li>
            <li>涉及码行数:   <xsl:value-of select="@lines" />
            </li>            
        </xsl:for-each>
        </div>
        </ul>
    </li>
    </xsl:for-each>
    </ul>
    </div>
    </li>
    </ul>
</xsl:for-each><!--week loop-->
</xsl:for-each><!--root-->
<!-- end of Page-->
</body>
</html>
</xsl:template>
</xsl:stylesheet>

要说

哈哈哈!老本行!快速的实现!

XSL

XSLT

version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:function="http://www.infopro.cn/epservernamespace" xmlns:msxsl="urn:schemas-microsoft-com:xslt">

JS

//o=document.getElementById('xxx');o.style.display=o.style.display=='none' ? : 'none' function _showDIV(divID){

} </script>}}}

CSS


-- ZoomQuiet [2005-01-05 11:27:12]

CvsWeeklyStat/WeeklycvsHow/weeklystat.xsl (last edited 2009-12-25 07:09:10 by localhost)