<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ou="http://omniupdate.com/XSL/Variables"
xmlns:ouc="http://omniupdate.com/XSL/Variables"
exclude-result-prefixes="xs ou ouc">

	<xsl:import href="../_shared/ouvariables.xsl" />
	<xsl:import href="../_shared/functions.xsl" />
	<xsl:import href="blog-functions.xsl" />
	<xsl:import href="blogvars.xsl"/>

	<xsl:strip-space elements="*" />
	<xsl:output method="xml" indent="yes" omit-xml-declaration="no"/>

	<xsl:template match="/document">
		<post link="{concat($domain,replace($ou:path,'\.blog','.aspx'))}" display="{post-info/ouc:div[@label='post-display']}">
			<xsl:if test="post-info/ouc:div[@label='post-featured'] = 'true'">
				<xsl:attribute name="featured">true</xsl:attribute>
			</xsl:if>
			<xsl:if test="post-info/ouc:div[@label='post-president'] = 'true'">
				<xsl:attribute name="president">true</xsl:attribute>
			</xsl:if>
			<title><xsl:value-of select="post-info/ouc:div[@label='post-title']" /></title>
			<author><xsl:value-of select="if (normalize-space(post-info/ouc:div[@label='post-author']) != '') then post-info/ouc:div[@label='post-author'] else $ou:username" /></author>
			<email><xsl:value-of select="if (normalize-space(post-info/ouc:div[@label='post-email']) != '') then post-info/ouc:div[@label='post-email'] else $ou:email" /></email>
			<description><xsl:value-of select="post-info/ouc:div[@label='post-description']" /></description>
			<pubDate><xsl:value-of select="ou:to-pub-date(ouc:properties[@label='config']/parameter[@name='date-time'])"/></pubDate>
			<tags><xsl:value-of select="normalize-space($page-tags)"/></tags>
			<categories><xsl:value-of select="normalize-space($page-categories)"/></categories>
			<xsl:if test="post-info/ouc:div[@label='post-img'] = 'img'">
				<image><img><xsl:copy-of select="post-info/ouc:div[@label='post-image']/img/attribute()" /></img></image>
			</xsl:if>
		</post>
	</xsl:template>

</xsl:stylesheet>
