|
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/">
<gzh_q1>
<xsl:apply-templates select="//*[@class='news-list' and count(./li[position()>=1 and count(./div[position()=2]/h3/a)>0 and count(.//*[@class='s1'])>0 and count(././/a[contains(@class,'account')]/text())>0])>0]" mode="gzh_q1"/>
</gzh_q1>
</xsl:template>
<xsl:template match="li[position()>=1]" mode="划定范围">
<item>
<name>
<xsl:value-of select="div[position()=2]/h3/a"/>
</name>
<read>
<xsl:value-of select="*//*[@class='s1']"/>
<xsl:value-of select="*[@class='s1']"/>
</read>
<gzh-name>
<xsl:value-of select=".//a[contains(@class,'account')]/text()"/>
</gzh-name>
<time>
<xsl:value-of select="*//*[@class='s2']/text()"/>
<xsl:value-of select="*[@class='s2']/text()"/>
<xsl:if test="@class='s2'">
<xsl:value-of select="text()"/>
</xsl:if>
</time>
</item>
</xsl:template>
<xsl:template match="//*[@class='news-list' and count(./li[position()>=1 and count(./div[position()=2]/h3/a)>0 and count(.//*[@class='s1'])>0 and count(././/a[contains(@class,'account')]/text())>0])>0]" mode="gzh_q1">
<item>
<划定范围>
<xsl:apply-templates select="li[position()>=1]" mode="划定范围"/>
</划定范围>
</item>
</xsl:template>
</xsl:stylesheet>
|
|