"Ciaran Hamilton" <[EMAIL PROTECTED]> writes:

> Hi,
>
> On Sun, April 23, 2006 4:25 am, Nic said:
>> Anyway... for those who are interested I've attached my program to
>> generate a simple HTML file.
>>
>> I've also attached an xslt that I use to turn it into something more
>> presentable.
>
> When I try to run it, it says:
>
>> cat: ./channel_uris: No such file or directory
>
> Is this a file we need to generate ourselves? I also notice that the .xslt
> file refers to a listings.css file, which you haven't attached.
>
> I'm interested in trying this though - thanks! :D

Another stylesheet that shows one day at a time.


Nic

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet  version="1.0"
                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

    <xsl:key name="trans_date" match="[EMAIL PROTECTED]" use="[EMAIL PROTECTED]'date']/@title"/>

    <xsl:template match="/">
        <html>
            <head>
                <title>The Ferrier Family TV Guide</title>
                <link rel="stylesheet" href="listings.css" type="text/css"/>
            </head>
            <body>
                <h1>Without it you're just flipping</h1>

                <table>
                    <tr>
                        <xsl:for-each select="//[EMAIL PROTECTED](. | key('trans_date', [EMAIL PROTECTED]'date']/@title)[1]) = 1]">
                            <xsl:sort select="[EMAIL PROTECTED]'date']/@title"/>
                            <td>
                                <a>
                                    <xsl:attribute name="href">#<xsl:value-of select="[EMAIL PROTECTED]'date']/@title"/></xsl:attribute>
                                    <xsl:value-of select="[EMAIL PROTECTED]'date']//text()"/>
                                </a>
                            </td>
                        </xsl:for-each>
                    </tr>
                </table>

                <table>
                    <xsl:for-each select="//[EMAIL PROTECTED](. | key('trans_date', [EMAIL PROTECTED]'date']/@title)[1]) = 1]">
                        <xsl:sort select="[EMAIL PROTECTED]'date']/@title"/>

                        <tr>
                            <td colspan="4">
                                <a>
                                    <xsl:attribute name="id"><xsl:value-of select="[EMAIL PROTECTED]'date']/@title"/></xsl:attribute>
                                    <h2><xsl:value-of select="[EMAIL PROTECTED]'date']//text()"/></h2>
                                </a>
                            </td>
                        </tr>
                        <tr>
		            <xsl:for-each select="key('trans_date', [EMAIL PROTECTED]'date']/@title)">
                                <td valign="top">
                                    <xsl:apply-templates select="." mode="channel"/>
                                </td>
		            </xsl:for-each>
                        </tr>
                    </xsl:for-each>
                </table>
            </body>
        </html>
    </xsl:template>

    <xsl:template match="[EMAIL PROTECTED]" mode="channel">
        <h3><xsl:value-of select="@id"/></h3>
        <table>
            <xsl:for-each select="[EMAIL PROTECTED]'listing']">
                <tr>
                    <td valign="top">
                        <a href="#{generate-id(.)}" id="{generate-id(.)}">
                            <xsl:copy-of select="[EMAIL PROTECTED]'time']"/>
                        </a>
                    </td>
                    <td valign="top">
                        <a href="#{generate-id(.)}" id="{generate-id(.)}">
                            <xsl:copy-of select="[EMAIL PROTECTED]'description']"/>
                        </a>
                        <xsl:if test="[EMAIL PROTECTED]'detail']">
                            <br/>
                            <xsl:copy-of select="[EMAIL PROTECTED]'detail']"/>
                        </xsl:if>
                    </td>
                </tr>
            </xsl:for-each>
        </table>
    </xsl:template>
</xsl:stylesheet>

Reply via email to