home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
WindowsServerTrial
/
server.iso
/
sources
/
install.wim
/
1
/
Windows
/
System32
/
msfeeds.dll
/
HTML
/
RSS2NORMALIZER.XSL
< prev
next >
Wrap
Extensible Markup Language
|
2008-01-19
|
30KB
|
576 lines
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005"
xmlns:msfeednorm="urn:microsoft:feed-normalization"
exclude-result-prefixes="dcterms msfeednorm"
>
<!-- Shared templates -->
<xsl:import href="res://msfeeds.dll/SharedNormalizer.xsl" />
<!-- Output XML UTF-8 -->
<xsl:output method="xml" encoding="utf-8" />
<!-- Figure out the type for RSS 2.0 text fields -->
<xsl:template name="_GetRSS2TypeValue">
<xsl:param name="type" />
<xsl:param name="default" />
<xsl:choose>
<xsl:when test="normalize-space($type) = 'html'">html</xsl:when>
<xsl:when test="normalize-space($type) = 'text'">text</xsl:when>
<xsl:when test="not(string($type)) or normalize-space($type) = ''"><xsl:value-of select="$default" /></xsl:when>
<xsl:otherwise>invalid</xsl:otherwise>
<!-- Note that unknown value for a type will yield empty output -->
</xsl:choose>
</xsl:template>
<!-- Entry point -->
<xsl:template match="/rss">
<rss>
<!-- Copy all namespaces -->
<xsl:for-each select="namespace::*"><xsl:copy /></xsl:for-each>
<!-- Ensure version is 2.0 -->
<xsl:attribute name="version">2.0</xsl:attribute>
<!-- Process channel -->
<channel>
<xsl:apply-templates select="channel" />
</channel>
</rss>
</xsl:template>
<!-- Channel processing -->
<xsl:template match="channel">
<!-- Copy all namespaces -->
<xsl:for-each select="namespace::*">
<xsl:copy />
</xsl:for-each>
<xsl:call-template name="_OutputXmlBase"><xsl:with-param name="value" select="@xml:base" /></xsl:call-template>
<xsl:call-template name="_OutputXmlLang"><xsl:with-param name="value" select="@xml:lang" /></xsl:call-template>
<xsl:if test="not(language)">
<xsl:call-template name="_OutputLanguage"><xsl:with-param name="value" select="@xml:lang" /></xsl:call-template>
</xsl:if>
<!-- Figure out the base URL value; xml:base overrides the download URL -->
<xsl:variable name="baseChannelUrl">
<xsl:call-template name="_GetFeedBaseUrl">
<xsl:with-param name="downloadUrl" select="$downloadUrl" />
<xsl:with-param name="rootNode" select="." />
</xsl:call-template>
</xsl:variable>
<!-- Build a list of referenced nodes from cf:sort and cf:group -->
<xsl:variable name="cfReferences">
<xsl:call-template name="_BuildCfReferenceList"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:variable>
<!-- Process channel elements -->
<xsl:apply-templates select="*" mode="channel">
<xsl:with-param name="baseChannelUrl" select="$baseChannelUrl" />
</xsl:apply-templates>
<!-- Process items -->
<xsl:apply-templates select="item">
<xsl:with-param name="baseChannelUrl" select="$baseChannelUrl" />
<xsl:with-param name="references" select="$cfReferences" />
</xsl:apply-templates>
</xsl:template>
<xsl:template match="*" mode="channel">
<xsl:param name="baseChannelUrl" />
<xsl:variable name="isFirst">
<xsl:call-template name="_IsFirstChildOfItsKind"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'title' and $isFirst = 'true'">
<xsl:variable name="type">
<xsl:call-template name="_GetRSS2TypeValue">
<xsl:with-param name="type" select="@cf:type" />
<xsl:with-param name="default" select="'text'" />
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="_OutputTitle">
<xsl:with-param name="value" select="." />
<xsl:with-param name="type" select="$type" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'link' and $isFirst = 'true'">
<xsl:variable name="linkUrl">
<xsl:call-template name="_CompleteUrl">
<xsl:with-param name="baseUrl" select="$baseChannelUrl" />
<xsl:with-param name="Url" select="." />
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="_OutputLink"><xsl:with-param name="value" select="$linkUrl" /></xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'description' and $isFirst = 'true'">
<xsl:variable name="type">
<xsl:call-template name="_GetRSS2TypeValue">
<xsl:with-param name="type" select="@cf:type" />
<xsl:with-param name="default" select="'text'" />
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="_OutputTextDescription">
<xsl:with-param name="value" select="." />
<xsl:with-param name="type" select="$type" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'pubDate' and $isFirst = 'true'">
<xsl:call-template name="_OutputPubDate"><xsl:with-param name="value" select="." /></xsl:call-template>
<xsl:if test="not(../lastBuildDate)">
<xsl:call-template name="_OutputLastBuildDate"><xsl:with-param name="value" select="." /></xsl:call-template>
<xsl:if test="not(../atom:updated)">
<xsl:call-template name="_OutputAtomUpdated"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:when>
<xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'published'">
</xsl:when>
<xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'updated'">
<xsl:if test="$isFirst = 'true'">
<xsl:call-template name="_OutputAtomUpdated"><xsl:with-param name="value" select="." /></xsl:call-template>
<xsl:if test="not(../pubDate) and not(../lastBuildDate)">
<xsl:call-template name="_OutputLastBuildDate"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'language' and $isFirst = 'true'">
<xsl:call-template name="_OutputLanguage"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'copyright' and $isFirst = 'true'">
<xsl:variable name="type">
<xsl:call-template name="_GetRSS2TypeValue">
<xsl:with-param name="type" select="@cf:type" />
<xsl:with-param name="default" select="'text'" />
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="_OutputCopyright">
<xsl:with-param name="value" select="." />
<xsl:with-param name="type" select="$type" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'lastBuildDate' and $isFirst = 'true'">
<xsl:call-template name="_OutputLastBuildDate"><xsl:with-param name="value" select="." /></xsl:call-template>
<xsl:if test="not(../atom:updated)">
<xsl:call-template name="_OutputAtomUpdated"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'managingEditor' and $isFirst = 'true'">
<xsl:variable name="convertToAtom">
<xsl:choose>
<xsl:when test="../atom:author">false</xsl:when>
<xsl:otherwise>true</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="_OutputManagingEditor">
<xsl:with-param name="value" select="." />
<xsl:with-param name="convertToAtom" select="$convertToAtom" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'webMaster' and $isFirst = 'true'">
<xsl:call-template name="_OutputWebMaster"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'category'">
<xsl:call-template name="_OutputCategory">
<xsl:with-param name="value" select="." />
<xsl:with-param name="domain" select="@domain" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'generator' and $isFirst = 'true'">
<xsl:call-template name="_OutputGenerator">
<xsl:with-param name="value" select="." />
<xsl:with-param name="uri" select="@cf:uri" />
<xsl:with-param name="version" select="@cf:version" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'docs' and $isFirst = 'true'">
<xsl:call-template name="_OutputDocs"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'cloud' and $isFirst = 'true'">
<xsl:call-template name="_OutputCloud"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'ttl' and $isFirst = 'true'">
<xsl:call-template name="_OutputTtl"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'image' and $isFirst = 'true'">
<xsl:variable name="imageUrl">
<xsl:call-template name="_CompleteUrl">
<xsl:with-param name="baseUrl" select="$baseChannelUrl" />
<xsl:with-param name="Url" select="url" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="imageLink">
<xsl:call-template name="_CompleteUrl">
<xsl:with-param name="baseUrl" select="$baseChannelUrl" />
<xsl:with-param name="Url" select="link" />
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="_OutputImage">
<xsl:with-param name="url" select="$imageUrl" />
<xsl:with-param name="title" select="title" />
<xsl:with-param name="link" select="$imageLink" />
<xsl:with-param name="width" select="width" />
<xsl:with-param name="height" select="height" />
<xsl:with-param name="description" select="description" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'rating' and $isFirst = 'true'">
<xsl:call-template name="_OutputRating"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'textInput' and $isFirst = 'true'">
<xsl:call-template name="_OutputTextInput">
<xsl:with-param name="title" select="title" />
<xsl:with-param name="name" select="name" />
<xsl:with-param name="link" select="link" />
<xsl:with-param name="description" select="description" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'skipHours' and $isFirst = 'true'">
<xsl:call-template name="_OutputSkipHours"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'skipDays' and $isFirst = 'true'">
<xsl:call-template name="_OutputSkipDays"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'link'">
<xsl:call-template name="_OutputAtomLink">
<xsl:with-param name="href" select="@href" />
<xsl:with-param name="rel" select="@rel" />
<xsl:with-param name="type" select="@type" />
<xsl:with-param name="title" select="@title" />
<xsl:with-param name="hreflang" select="@hreflang" />
<xsl:with-param name="length" select="@length" />
<xsl:with-param name="xmlBase" select="@xml:base" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'author'">
<xsl:if test="$isFirst = 'true'">
<xsl:call-template name="_OutputAtomAuthor">
<xsl:with-param name="name" select="atom:name" />
<xsl:with-param name="email" select="atom:email" />
<xsl:with-param name="uri" select="atom:uri" />
</xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'contributor'">
<xsl:call-template name="_OutputAtomContributor">
<xsl:with-param name="name" select="atom:name" />
<xsl:with-param name="email" select="atom:email" />
<xsl:with-param name="uri" select="atom:uri" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = $_NScf and local-name(.) = 'treatAs'">
<xsl:if test="$isFirst = 'true'">
<xsl:call-template name="_OutputCfTreatAs"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:when test="namespace-uri(.) = $_NScf and local-name(.) = 'listinfo'">
<xsl:if test="$isFirst = 'true'">
<xsl:call-template name="_OutputCfListinfo"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'item'">
<!-- Do nothing here for items -->
</xsl:when>
<!-- Copy extension nodes -->
<xsl:when test="namespace-uri(.) != ''">
<xsl:call-template name="_OutputExtension"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- Item processing -->
<xsl:template match="item">
<xsl:param name="baseChannelUrl" />
<xsl:param name="references" />
<item>
<!-- Copy all namespaces -->
<xsl:for-each select="namespace::*">
<xsl:copy />
</xsl:for-each>
<xsl:call-template name="_OutputXmlBase"><xsl:with-param name="value" select="@xml:base" /></xsl:call-template>
<xsl:call-template name="_OutputXmlLang"><xsl:with-param name="value" select="@xml:lang" /></xsl:call-template>
<!-- Item's base URL stacks onto channel's base URL -->
<xsl:variable name="baseChannelItemUrl">
<xsl:call-template name="_CombineUrls">
<xsl:with-param name="baseUrl" select="$baseChannelUrl" />
<xsl:with-param name="relUrl" select="@xml:base" />
</xsl:call-template>
</xsl:variable>
<!-- Process item elements -->
<xsl:apply-templates select="*" mode="item">
<xsl:with-param name="baseItemUrl" select="$baseChannelItemUrl" />
<xsl:with-param name="references" select="$references" />
</xsl:apply-templates>
</item>
</xsl:template>
<xsl:template match="*" mode="item">
<xsl:param name="baseItemUrl" />
<xsl:param name="references" />
<xsl:variable name="isFirst">
<xsl:call-template name="_IsFirstChildOfItsKind"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'title' and $isFirst = 'true'">
<xsl:variable name="type">
<xsl:call-template name="_GetRSS2TypeValue">
<xsl:with-param name="type" select="@cf:type" />
<xsl:with-param name="default" select="'text'" />
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="_OutputTitle">
<xsl:with-param name="value" select="." />
<xsl:with-param name="type" select="$type" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'link' and $isFirst = 'true'">
<xsl:variable name="linkUrl">
<xsl:call-template name="_CompleteUrl">
<xsl:with-param name="baseUrl" select="$baseItemUrl" />
<xsl:with-param name="Url" select="." />
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="_OutputLink"><xsl:with-param name="value" select="$linkUrl" /></xsl:call-template>
</xsl:when>
<xsl:when test="(namespace-uri(.) = '' and local-name(.) = 'author') or (namespace-uri(.) = $_NSdc and local-name(.) = 'creator')">
<xsl:variable name="convertToAtom">
<xsl:choose>
<xsl:when test="../atom:author">false</xsl:when>
<xsl:otherwise>true</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="_OutputAuthor">
<xsl:with-param name="value" select="." />
<xsl:with-param name="convertToAtom" select="$convertToAtom" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'contributor'">
<xsl:call-template name="_OutputAtomContributor">
<xsl:with-param name="name" select="atom:name" />
<xsl:with-param name="email" select="atom:email" />
<xsl:with-param name="uri" select="atom:uri" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'category'">
<xsl:call-template name="_OutputCategory">
<xsl:with-param name="value" select="." />
<xsl:with-param name="domain" select="@domain" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'comments' and $isFirst = 'true'">
<xsl:variable name="commentUrl">
<xsl:call-template name="_CompleteUrl">
<xsl:with-param name="baseUrl" select="$baseItemUrl" />
<xsl:with-param name="Url" select="." />
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="_OutputComments"><xsl:with-param name="value" select="$commentUrl" /></xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'enclosure'">
<xsl:variable name="enclosureUrl">
<xsl:call-template name="_CompleteUrl">
<xsl:with-param name="baseUrl" select="$baseItemUrl" />
<xsl:with-param name="Url" select="@url" />
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="_OutputEnclosure">
<xsl:with-param name="url" select="$enclosureUrl" />
<xsl:with-param name="length" select="@length" />
<xsl:with-param name="type" select="@type" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'guid' and $isFirst = 'true'">
<xsl:choose>
<xsl:when test="normalize-space(@isPermaLink) = 'true' or not(string(@isPermaLink))">
<xsl:variable name="linkUrl">
<xsl:call-template name="_CompleteUrl">
<xsl:with-param name="baseUrl" select="$baseItemUrl" />
<xsl:with-param name="Url" select="." />
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="_OutputGuid">
<xsl:with-param name="value" select="$linkUrl" />
<xsl:with-param name="isPermaLink" select="@isPermaLink" />
</xsl:call-template>
<!-- If there is no link we'll use permalink guid instead -->
<xsl:if test="not(../link)">
<xsl:call-template name="_OutputLink"><xsl:with-param name="value" select="$linkUrl" /></xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="_OutputGuid">
<xsl:with-param name="value" select="." />
<xsl:with-param name="isPermaLink" select="@isPermaLink" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'pubDate' and $isFirst = 'true'">
<xsl:call-template name="_OutputPubDate"><xsl:with-param name="value" select="." /></xsl:call-template>
<xsl:if test="not(../atom:published)">
<xsl:call-template name="_OutputAtomPublished"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:if>
<xsl:if test="not(../atom:updated) and not(../dcterms:modified)">
<xsl:call-template name="_OutputAtomUpdated"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:when test="namespace-uri(.) = $_NSdc and local-name(.) = 'date'">
<xsl:if test="$isFirst = 'true' and not(../pubDate) and not(../dcterms:modified) and not(../atom:updated)">
<xsl:call-template name="_OutputAtomUpdated"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:when test="namespace-uri(.) = $_NSdcterms and local-name(.) = 'modified'">
<xsl:if test="$isFirst = 'true' and not(../atom:updated)">
<xsl:call-template name="_OutputAtomUpdated"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'updated'">
<xsl:if test="$isFirst = 'true'">
<xsl:call-template name="_OutputAtomUpdated"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'published'">
<xsl:if test="$isFirst = 'true'">
<xsl:call-template name="_OutputAtomPublished"><xsl:with-param name="value" select="." /></xsl:call-template>
<xsl:if test="not(../pubDate)">
<xsl:call-template name="_OutputPubDate"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:when>
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'source' and $isFirst = 'true'">
<xsl:variable name="srcUrl">
<xsl:call-template name="_CompleteUrl">
<xsl:with-param name="baseUrl" select="$baseItemUrl" />
<xsl:with-param name="Url" select="@url" />
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="_OutputSource">
<xsl:with-param name="value" select="." />
<xsl:with-param name="url" select="$srcUrl" />
</xsl:call-template>
</xsl:when>
<!-- content:encoded takes precedence over the description -->
<xsl:when test="namespace-uri(.) = $_NScontent and local-name(.) = 'encoded'">
<xsl:if test="$isFirst = 'true'">
<xsl:variable name="summType">
<xsl:call-template name="_GetRSS2TypeValue">
<xsl:with-param name="type" select="../description/@cf:type" />
<xsl:with-param name="default" select="'html'" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="baseDescUrl">
<xsl:call-template name="_CombineUrls">
<xsl:with-param name="baseUrl" select="$baseItemUrl" />
<xsl:with-param name="relUrl" select="@xml:base" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="baseSummUrl">
<xsl:call-template name="_CombineUrls">
<xsl:with-param name="baseUrl" select="$baseItemUrl" />
<xsl:with-param name="relUrl" select="../description/@xml:base" />
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="_OutputDescriptionAndSummary">
<xsl:with-param name="description" select="." />
<xsl:with-param name="descriptionType" select="'html'" />
<xsl:with-param name="descriptionBaseUrl" select="$baseDescUrl" />
<xsl:with-param name="summary" select="../description" />
<xsl:with-param name="summaryType" select="$summType" />
<xsl:with-param name="summaryXmlBase" select="../description/@xml:base" />
<xsl:with-param name="summaryBaseUrl" select="$baseSummUrl" />
</xsl:call-template>
</xsl:if>
</xsl:when>
<!-- description will be used if there is no content:encoded -->
<xsl:when test="namespace-uri(.) = '' and local-name(.) = 'description' and $isFirst = 'true'">
<xsl:if test="not(../*[namespace-uri(.) = $_NScontent and local-name(.) = 'encoded'])">
<xsl:variable name="type">
<xsl:call-template name="_GetRSS2TypeValue">
<xsl:with-param name="type" select="@cf:type" />
<xsl:with-param name="default" select="'html'" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="baseDescUrl">
<xsl:call-template name="_CombineUrls">
<xsl:with-param name="baseUrl" select="$baseItemUrl" />
<xsl:with-param name="relUrl" select="@xml:base" />
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="_OutputDescription">
<xsl:with-param name="value" select="." />
<xsl:with-param name="type" select="$type" />
<xsl:with-param name="baseUrl" select="$baseDescUrl" />
</xsl:call-template>
</xsl:if>
</xsl:when>
<!-- atom:summary will be preserved unless both content:encoded and description are present -->
<xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'summary'">
<xsl:if test="$isFirst = 'true' and not(../description and ../*[namespace-uri(.) = $_NScontent and local-name(.) = 'encoded'])">
<xsl:variable name="baseSummUrl">
<xsl:call-template name="_CombineUrls">
<xsl:with-param name="baseUrl" select="$baseItemUrl" />
<xsl:with-param name="relUrl" select="@xml:base" />
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="_OutputAtomSummary">
<xsl:with-param name="value" select="." />
<xsl:with-param name="type" select="@type" />
<xsl:with-param name="xmlBase" select="@xml:base" />
<xsl:with-param name="baseUrl" select="$baseSummUrl" />
</xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'link'">
<xsl:call-template name="_OutputAtomLink">
<xsl:with-param name="href" select="@href" />
<xsl:with-param name="rel" select="@rel" />
<xsl:with-param name="type" select="@type" />
<xsl:with-param name="title" select="@title" />
<xsl:with-param name="hreflang" select="@hreflang" />
<xsl:with-param name="length" select="@length" />
<xsl:with-param name="xmlBase" select="@xml:base" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'author'">
<xsl:call-template name="_OutputAtomAuthor">
<xsl:with-param name="name" select="atom:name" />
<xsl:with-param name="email" select="atom:email" />
<xsl:with-param name="uri" select="atom:uri" />
</xsl:call-template>
</xsl:when>
<xsl:when test="namespace-uri(.) = $_NSslash and local-name(.) = 'comments'">
<xsl:if test="$isFirst = 'true'">
<xsl:call-template name="_OutputSlashComments"><xsl:with-param name="value" select="." /></xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:when test="namespace-uri(.) = $_NSwfw and (local-name(.) = 'commentRss' or local-name(.) = 'commentRSS')">
<xsl:if test="$isFirst = 'true'">
<xsl:variable name="commentRssUrl">
<xsl:call-template name="_CompleteUrl">
<xsl:with-param name="baseUrl" select="$baseItemUrl" />
<xsl:with-param name="Url" select="." />
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="_OutputWfwCommentRSS"><xsl:with-param name="value" select="$commentRssUrl" /></xsl:call-template>
</xsl:if>
</xsl:when>
<!-- Copy extension nodes -->
<xsl:when test="namespace-uri(.) != ''">
<xsl:call-template name="_OutputExtension">
<xsl:with-param name="value" select="." />
<xsl:with-param name="references" select="$references" />
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>