zoukankan      html  css  js  c++  java
  • 用于解析 sohu 新闻页面的 XSLT 文件

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
     <xsl:template match="/">
      <html>
       <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>SOHU newsletter</title>
       </head>
       <body>
        <h1>
         <xsl:value-of select="html/body/table[position()=2]/tbody/tr/td/table[position()=2]/tbody/tr/td"/>
        </h1>
        <p>
         <xsl:apply-templates select="html/body/table[position()=2]/tbody/tr/td/table[position()=5]/tbody/tr[position()=3]"/>
        </p>
       </body>
      </html>
     </xsl:template>
     <!-- 显示段落 -->
     <xsl:template match="p">
      <p>
       <xsl:value-of select="text()"/>
      </p>
     </xsl:template>
     <xsl:template match="text()">
     </xsl:template>
    </xsl:stylesheet>
  • 相关阅读:
    IDEA快捷键
    nginx之epoll模型的详细介绍
    Liunx权限修改命令
    小技巧3
    小技巧2
    小技巧1
    Ajax的简单使用
    dubbo
    快速创建虚拟机
    登录和注册功能的实现
  • 原文地址:https://www.cnblogs.com/haogj/p/339147.html
Copyright © 2011-2022 走看看