diff options
-rw-r--r-- | source/99_result/atom.xsl | 50 | ||||
-rw-r--r-- | utility/master.xsl | 4 |
2 files changed, 52 insertions, 2 deletions
diff --git a/source/99_result/atom.xsl b/source/99_result/atom.xsl new file mode 100644 index 0000000..86f0217 --- /dev/null +++ b/source/99_result/atom.xsl @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet + version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" +> + +<xsl:output + method="xml" + omit-xml-declaration="no" + encoding="UTF-8" + indent="yes" +/> + +<xsl:variable name="meta"> + <datasource type="main" mode="full" source="target/02_data/articles.xml" target="articles"/> + <datasource type="support" mode="full" source="target/03_meta/meta.xml" target="meta"/> + <target mode="plain" value="atom.xml"/> +</xsl:variable> + +<xsl:variable name="url" select="datasource/meta/url"/> + +<xsl:template match="/"> + <feed xmlns="http://www.w3.org/2005/Atom"> + <id><xsl:value-of select="$url"/></id> + <title><xsl:value-of select="datasource/meta/title"/></title> + <author> + <name>Adrian Kummerländer</name> + </author> + + <xsl:apply-templates select="datasource/articles/entry"/> + </feed> +</xsl:template> + +<xsl:template match="datasource/articles/entry"> + <entry> + <title><xsl:value-of select="title"/></title> + <link><xsl:value-of select="$url"/>/article/<xsl:value-of select="@handle"/></link> + <content type="xhtml"> + <div xmlns="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + <xsl:copy-of select="content/node()"/> + </div> + </content> + <published> + <xsl:value-of select="date/full"/> + <xsl:text>T00:00:01+02:00</xsl:text> + </published> + </entry> +</xsl:template> + +</xsl:stylesheet> diff --git a/utility/master.xsl b/utility/master.xsl index 698aed5..cda2575 100644 --- a/utility/master.xsl +++ b/utility/master.xsl @@ -51,7 +51,7 @@ <li><a href="{$url}/archive">Archive</a></li> <li><a href="{$url}/projects">Projects</a></li> <li><a href="{$url}/page/contact">Contact</a></li> - <li class="last_item"><a href="{$url}/rss">RSS</a></li> + <li class="last_item"><a href="{$url}/atom.xml">Feed</a></li> </ul> </div> <div id="main"> @@ -67,7 +67,7 @@ <a href="https://github.com/KnairdA/InputXSLT">Made with XSLT</a> <ul> <li><a href="{$url}/page/contact">Contact</a></li> - <li class="last_item"><a href="{$url}/rss">RSS</a></li> + <li class="last_item"><a href="{$url}/atom.xml">Feed</a></li> </ul> </div> </div> |