mirror of
https://github.com/standardebooks/web.git
synced 2025-07-16 03:16:36 -04:00
Add XSLT stylesheet for RSS feed
This commit is contained in:
parent
30a3dd053f
commit
a3d823dd5a
5 changed files with 60 additions and 6 deletions
39
www/rss/style.php
Normal file
39
www/rss/style.php
Normal file
|
@ -0,0 +1,39 @@
|
|||
<?
|
||||
require_once('Core.php');
|
||||
header('content-type: application/xslt+xml');
|
||||
print("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
|
||||
?>
|
||||
<xsl:stylesheet version="3.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<xsl:output method="html" html-version="5.0" encoding="utf-8" indent="true"/>
|
||||
<xsl:template match="/">
|
||||
<?= Template::Header(['xmlDeclaration' => false]) ?>
|
||||
<main>
|
||||
<h1><xsl:value-of select="substring-after(/rss/channel/title, 'Standard Ebooks - ')"/></h1>
|
||||
<p><xsl:value-of select="/rss/channel/description"/></p>
|
||||
<p>This page is an RSS feed. The URL in your address bar (<a ><xsl:attribute name="href"><xsl:value-of select="/rss/channel/atom:link/@href"/></xsl:attribute><xsl:value-of select="/rss/channel/atom:link/@href"/></a>) can be used in any RSS reader.</p>
|
||||
<ol class="rss">
|
||||
<xsl:for-each select="/rss/channel/item">
|
||||
<li>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="link"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="title"/>
|
||||
</a>
|
||||
<ul class="tags">
|
||||
<xsl:for-each select="category">
|
||||
<li>
|
||||
<p><xsl:value-of select="."/></p>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
<p>
|
||||
<xsl:value-of select="description"/>
|
||||
</p>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</ol>
|
||||
</main>
|
||||
<?= Template::Footer() ?>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
Loading…
Add table
Add a link
Reference in a new issue