xsl转化HTML

  <?xml version="1.0" encoding="utf-8" ?>
- < xsl:stylesheet version =" 1.0 " xmlns:xsl =" http://www.w3.org/1999/XSL/Transform ">
- < xsl:template match =" /root ">
- < html >
+ < head >
  < style style =" text/css "> div{font-size:12px} img{border:1px solid #000} .big a { font-size:18px;font-family:黑体;color: #000; text-decoration:none;} .big a:link {font-size:18px;font-family:黑体;color: #000; text-decoration:none;} .big a:visited {font-size:18px;font-family:黑体;color: #666666; text-decoration:none;} .big a:hover {font-size:18px;font-family:黑体;color: #BE0000; text-decoration:underline;} .list a { font-size:12px;color: #000; text-decoration:none;} .list a:link {font-size:12px;color: #000; text-decoration:none;} .list a:visited {font-size:12px;color: #666666; text-decoration:none;} .list a:hover {font-size:12px;color: #BE0000; text-decoration:underline;} .im a { font-size:12px;color: #fff; text-decoration:none;width=100%;height:23px:overflow:hidden;background-color:#ef0001;text-align:center;line-height:20px;margin-top:7px;padding:1px} .im a:link {font-size:12px;color: #fff; text-decoration:none;width=100%;height:23px:overflow:hidden;background-color:#ef0001;text-align:center;line-height:20px;margin-top:7px;padding:1px} .im a:visited {font-size:12px;color: #666666; text-decoration:none;width=100%;height:23px:overflow:hidden;background-color:#ef0001;text-align:center;line-height:20px;margin-top:7px;padding:1px} .im a:hover {font-size:12px;color: #fff; text-decoration:underline;width=100%;height:23px:overflow:hidden;background-color:#ef0001;text-align:center;line-height:20px;margin-top:7px;padding:1px} li {line-height: 24px;list-style-type: none;overflow: hidden;} </ style >
  </ head >
- < div style =" width:152px;height:291;overflow:hidden;margin-left:2px;float:left; ">
<!--
图片新闻
  --> <script type="text/javascript">f(clean);</script>
- < div style =" margin-left:0px; ">
- < xsl:for-each select =" list[@img != ''] ">
- < xsl:if test =" position()=1 ">
- < div id =" image " style =" width:152px:height:114px ">
- < a target =" _blank ">
- < xsl:attribute name =" href ">
  < xsl:value-of select =" @url " />
  </ xsl:attribute >
- < img width =" 150px " height =" 115px ">
- < xsl:attribute name =" title ">
  < xsl:value-of select =" @subhead " />
  </ xsl:attribute >
- < xsl:attribute name =" src ">
  < xsl:value-of select =" @img " />
  </ xsl:attribute >
  </ img >
  </ a >
  </ div >
+ < div class =" im " style =" width:152px;height:28px;overflow:hidden; ">
- < a target =" _blank ">
- < xsl:attribute name =" href ">
  < xsl:value-of select =" @url " />
  </ xsl:attribute >
  < xsl:value-of select =" @subhead " />
  </ a >
  </ div >
  </ xsl:if >
  </ xsl:for-each >
  </ div >
<!--
广告
  --> <script type="text/javascript">f(clean);</script>
- < div style =" width:152px;height:130px;overflow:hidden;top:158px;padding-top:10px ">
  < iframe scrolling =" no " frameborder =" 0 " width =" 152 " height =" 117 " src =" /Channel/game/yxadv/yxindexadv.xml " />
  </ div >
  </ div >
+ < div style =" width:280px;height:270px;overflow:hidden;padding-left:5px ">
- < xsl:for-each select =" list ">
- < xsl:choose >
- < xsl:when test =" position() = 1 and @up='true' ">
- < div style =" text-align:center; padding-left:5px; padding-top:2px; " class =" big ">
- < a target =" _blank ">
- < xsl:attribute name =" href ">
  < xsl:value-of select =" @url " />
  </ xsl:attribute >
  < xsl:value-of select =" @title " />
  </ a >
  </ div >
- < div style =" line-height:20px;padding-left:5px;padding-top:4px;padding-bottom:5px ">
- < font color =" #1f3a87 ">
    
  < xsl:value-of select =" @subhead " />
  </ font >
  </ div >
  </ xsl:when >
- < xsl:otherwise >
- < li style =" width:280px;height:22px;overflow:hidden;line-height:25px;float:left; " class =" list ">
  ·
- < a target =" _blank ">
- < xsl:attribute name =" href ">
  < xsl:value-of select =" @url " />
  </ xsl:attribute >
  < xsl:value-of select =" @title " />
  </ a >
  </ li >
  </ xsl:otherwise >
  </ xsl:choose >
  </ xsl:for-each >
  </ div >
  </ html >
  </ xsl:template >
  </ xsl:stylesheet >
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值