index.xsl

<?xml version="1.0" encoding="GB2312"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
  <head>
   <title>天凡的小窝</title>
   <meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
   <link type="text/css" media="all" rel="stylesheet" href="index.css"/>
  </head>
  <body>
  <div id="top">
   <div id="menu"> <!--顶部菜单-->
     <ul>
      <xsl:apply-templates select="//menu"/>
     </ul>
   </div>
   </div>
   <div id="logoarea"> <!--logo和banner-->
   </div>
   <div id="main"><!--主体部分-->
     <div id="mainleft"><!--主体左侧-->
      <div id="leftbulletin"><!--左侧公告-->
       <xsl:apply-templates select="//bulletin"/>
      </div>
      <div><!--关于本站-->
       <xsl:apply-templates select="//aboutmysite"/>
      </div>
      <div><!--新文章列表-->
      <div class="lefttitle">新日志列表</div>
      <div class="listul">
      <ul>
       <xsl:apply-templates select="//mytitlelist"/>
       </ul>
      </div>
      </div>
      <div><!--友情链接-->
      <div class="lefttitle">友情链接</div>
      <div class="listul">
       <ul>
       <xsl:apply-templates select="//myfriendlink"/>
       </ul>
       </div>
      </div>
     </div>
     <div><!--主体右侧-->
      <ul>
      <xsl:apply-templates select="//mybloglist"/>
      </ul>
     </div>
   </div>
   <div id="bottom"><!--底部版权部分-->
     <xsl:apply-templates select="//copyright"/>
   </div> 
  </body>
</html>
</xsl:template>
<xsl:template match="//menu">
  <xsl:for-each select="child::topmenu">
  <li>
   <a target="_blank">
    <xsl:attribute name="href">
     <xsl:value-of select="hyperlink"/>
    </xsl:attribute>   
    <xsl:value-of select="item"/>
   </a>
  </li>
</xsl:for-each>
</xsl:template>
<xsl:template match="//bulletin">
  <div class="lefttitle">本站公告</div>
  <div class="left2">
   <xsl:value-of select="content"/>
  </div>
  <div id="bulletintime">
   <xsl:value-of select="time"/>
  </div>
</xsl:template>
<xsl:template match="// aboutmysite">
  <div class="lefttitle">关于本站</div>
  <div class="left2">
   <xsl:value-of select="content"/>
  </div>
  <div id="bulletintime">
   <xsl:value-of select="time"/>
  </div>
</xsl:template>
<xsl:template match="mytitlelist">
  <xsl:for-each select="child::titlelist">
   <li>
    <a target="_blank">
    <xsl:attribute name="href">
     <xsl:value-of select="hyperlink"/>
    </xsl:attribute>   
    <xsl:value-of select="item"/>
   </a>
   </li>
  </xsl:for-each>
</xsl:template>
<xsl:template match="//myfriendlink">
    <xsl:for-each select="child::friendlink">
   <li>
    <a target="_blank">
    <xsl:attribute name="href">
     <xsl:value-of select="hyperlink"/>
    </xsl:attribute>   
    <xsl:value-of select="item"/>
   </a>
   </li>
  </xsl:for-each>
</xsl:template>

<xsl:template match="//mybloglist">
   <xsl:for-each select="child::bloglist">
   <li class="bloglist">
    <div>标题:<xsl:value-of select="title"/></div>
    <div>日志发表时间:<xsl:value-of select="time"/>日志类别:<xsl:value-of select="kind"/></div>
    <div class="myblogcontent">内容摘要:
    <a target="_blank">
    <xsl:attribute name="href">
     <xsl:value-of select="hyperlink"/>
    </xsl:attribute>   
    <xsl:value-of select="item"/>
   </a>
   </div>
   <div>浏览量:<xsl:value-of select="clicknum"/></div>
   </li>
  </xsl:for-each>
</xsl:template>
<xsl:template match="//copyright">
  <div><xsl:value-of select="author"/></div>
  <div><xsl:value-of select="time"/>
  <xsl:value-of select="version"/></div>
  <div>E-mail:<xsl:value-of select="email"/></div>
</xsl:template>
</xsl:stylesheet>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值