IBM®
跳转到主要内容
    中国 [选择]    使用条款
 
 
Select a scope: Search for:    
    首页    产品    服务与解决方案     支持与下载    个性化服务    
跳转到主要内容

developerWorks 中国  >  XML | Web development  >

Extending XSLT

Listing 2

developerWorks

返回原文..


<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output version="1.0" indent="yes" encoding="UTF-8" omit-xml-declaration="no" method="xml"/>
  
  <xsl:template match="/html">
    <RESULT>
      <WEATHER>
        <xsl:apply-templates/>
      </WEATHER>
    </RESULT>
  </xsl:template>
  <xsl:template match="text()"></xsl:template>
  <xsl:template match="table[starts-with(normalize-space(.),'Appar Temp')]">
    <TEMPERATURE>
      <xsl:value-of select="tr/td[2]/font"/>
    </TEMPERATURE>
	
    <HUMIDITY>
      <xsl:value-of select="tr[3]/td[2]/font"/>
    </HUMIDITY>
  </xsl:template>
</xsl:stylesheet>

返回原文.
    关于 IBM 隐私条约 联系 IBM 使用条款