service.atom.xsl 2.36 KB
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:php="http://php.net/xsl" >
	<xsl:output method="xml" encoding="utf-8"  indent="yes" />
	<xsl:template match="/">
		<feed xmlns="http://www.w3.org/2005/Atom">
			<author>
				<name type="text"><xsl:value-of select="content/BasisElement/Author_NickName"/></name>
			</author>
			<title type="text"><xsl:value-of select="content/BasisElement/Headline/Element"/></title>
			<id><xsl:value-of select="content/BasisElement/@ID"/></id>
			<updated><xsl:value-of select="content/BasisElement/CreateDate"/></updated>
			<xsl:for-each select="content/BasisElement/BasisClipboard/List/BasisElement">
				<entry>
					<title type="text"><xsl:value-of select="Headline/Element"/></title>					
					<link href="{concat(Link/@host,'/',Link/@url,'?',Link/@parameter)}"/>
					<id><xsl:value-of select="@ID"/></id>
					<updated><xsl:variable name="var_date" select="CreateDate"/>
							<xsl:value-of select="substring($var_date,9,2)"/><xsl:text> </xsl:text>
							 <xsl:choose>
								<xsl:when test="substring($var_date,6,2) = '01'">Jan</xsl:when>
								<xsl:when test="substring($var_date,6,2) = '02'">Feb</xsl:when>
								<xsl:when test="substring($var_date,6,2) = '03'">Mar</xsl:when>
								<xsl:when test="substring($var_date,6,2) = '04'">Apr</xsl:when>
								<xsl:when test="substring($var_date,6,2) = '05'">May</xsl:when>
								<xsl:when test="substring($var_date,6,2) = '06'">Jun</xsl:when>
								<xsl:when test="substring($var_date,6,2) = '07'">Jul</xsl:when>
								<xsl:when test="substring($var_date,6,2) = '08'">Aug</xsl:when>
								<xsl:when test="substring($var_date,6,2) = '09'">Sep</xsl:when>
								<xsl:when test="substring($var_date,6,2) = '10'">Oct</xsl:when>
								<xsl:when test="substring($var_date,6,2) = '11'">Nov</xsl:when>
								<xsl:when test="substring($var_date,6,2) = '12'">Dec</xsl:when>
							</xsl:choose><xsl:text> </xsl:text>
							<xsl:value-of select="substring($var_date,1,4)"/><xsl:text> </xsl:text><xsl:value-of select="substring($var_date,12)"/><xsl:text> +0100</xsl:text></updated>
					<summary><xsl:variable name="var_text" select="Subheading/Element[@objvar='Text']"/><xsl:value-of select="php:functionString('strip_tags', $var_text)"/></summary>					
				</entry>
			</xsl:for-each>
		</feed>	
	</xsl:template>
</xsl:stylesheet>