﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:output omit-xml-declaration ="yes"/>

    <xsl:template match="/">

        <xsl:variable name="HostName" select="normalize-space(Publications/HostName)"></xsl:variable>
        <xsl:variable name="TemplateURL" select="normalize-space(Publications/TemplateURL)"/>

        <rss version="2.0" 	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss"
             xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
             xmlns:media="http://search.yahoo.com/mrss/">

            <channel>
                <title>List Publications</title>
                <link>
                    <xsl:text>http://</xsl:text>
                    <xsl:value-of select="$HostName"></xsl:value-of>
                    <xsl:text>/ListPublications.aspx</xsl:text>
                </link>
                <description>List of our latest Publications...</description>
                <image>
                    <url>
                        <xsl:text>http://</xsl:text>
                        <xsl:value-of select="$HostName"></xsl:value-of>
                        <xsl:text>/DesktopModules/LifeSpaceTemplates/Web/Images/LifeSpaceLogo.jpg</xsl:text>
                    </url>
                    <link>
                        <xsl:text>http://</xsl:text>
                        <xsl:value-of select="$HostName"></xsl:value-of>
                        <xsl:text>/Home.aspx</xsl:text>
                    </link>
                </image>
                <xsl:for-each select="Publications/Publication">
                    <item>
                        <title>
                            <xsl:value-of select="Title"/>
                        </title>
                        <link>
                            <xsl:text>http://</xsl:text>
                            <xsl:value-of select="$HostName"></xsl:value-of>
                            <xsl:text>/Publication.aspx?ID=</xsl:text>
                            <xsl:value-of select="normalize-space(ItemID)"/>
                        </link>
                        <description>
                            <xsl:value-of select="Summary"/>
                        </description>
                    </item>
                </xsl:for-each>
            </channel>
        </rss>
    </xsl:template>
</xsl:stylesheet>
