OK Here is what I do for the NY Times. The only problem I have is that front page headlines are not linked to the articles. There is normally a link in the paper section links so I've been too lazy to fix it.

<site lastConverted="2003-10-29 06:19:16" lastSize="307791" userAgent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2.1) Gecko/20021130" linkColor="blue" unresolvedLinkColor="red">
<name>New York Times</name>
<uri maxDepth="1" restrict="host">http://www.nytimes.com/index.html</uri>



<images>
<embedded bpp="8" maxWidth="320" maxHeight="320"/>
</images>
<category>News</category>
<schedule>
<daily hour="4" minute="0"/>
</schedule>
<transform pattern=".*">
<xsl href="nytimes.xsl"/>
</transform>
</site>


; my nytimes.xsl file is

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:import href="jpluck.xsl"/>
<xsl:template match="/">
<html>
<body>
<xsl:choose>
<xsl:when test="contains('http://www.nytimes.com/index.html', $uri)">
<!-- Main index -->
<h1>
<xsl:value-of select="/html/head/title"/>
</h1>
<xsl:apply-templates select="/html/body/table[2]/tr/td[3]/table/tr/td"/>
</xsl:when>
<xsl:when test="contains($uri, '/text/')">
<!-- Section index -->
<h1>
<xsl:value-of select="/html/head/title"/>
</h1>
<xsl:choose>
<xsl:when test="contains($uri, 'health') or contains($uri, 'national')">
<xsl:apply-templates select="/html/body/table[2]/tr/td[3]/table/tr/td[2]"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="/html/body/table[2]/tr/td[3]/table/tr[4]/td[2]/table/tr/td[2]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<!-- Articles -->
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</body>
</html>
</xsl:template>
<xsl:template match="a">
<xsl:choose>
<xsl:when test="substring(@href, string-length(@href)-4)='.html'">
<a href="[EMAIL PROTECTED]&amp;position=">
<xsl:apply-templates/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="//img">
<!-- Replace drop caps, remove all other images -->
<xsl:if test="contains(@src, 'dropcap')">
<xsl:value-of select="@alt"/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>


Happy plucking;
Rob



_______________________________________________
plucker-list mailing list
[EMAIL PROTECTED]
http://lists.rubberchicken.org/mailman/listinfo/plucker-list

Reply via email to