403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/Windows/System32/es-ES/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/Windows/System32/es-ES/Windows.Web.dll.mui
MZ����@���	�!�L�!This program cannot be run in DOS mode.

$5�<�q�R�q�R�q�R�e���p�R�e�P�p�R�Richq�R�PEL�!�

�ܷ@ �8.rdata�@@.rsrc� �@@��
T88��$��8.rdata8x.rdata$zzzdbg p.rsrc$01p#0�.rsrc$02 ��e3s#��<��'�l�<��;*��x����8�P�x�������r��T�U(�@�X���p������������>���
�
�


(
8
H
X
h
x
�h#�� $���&h�(+��3Y�4�����T����V��;MH��,u�����MUIATOM03NORMALIZER.XSLATOM1NORMALIZER.XSLRSS1NORMALIZER.XSLRSS2NORMALIZER.XSLSHAREDNORMALIZER.XSL���茘{��|<[+<�xG�k#G��(�3�Km���MUIes-ES#'%1': el valor no debe estar vac�o.W'%1': el b�fer no tiene espacio suficiente para albergar el n�mero solicitado de bytes.+'%1': se encontraron caracteres no v�lidos.Encabezados HTTP no v�lidos.&Estado de respuesta de HTTP no v�lido.Y'%1': el valor proporcionado no es un valor de ChainValidationResult que se pueda omitir.'%1': solo se admite Atom 1.0.('%1': solo se admite Atom 1.0 y RSS 2.0.@Solo se admite Atom 0.3, Atom 1.0, RSS 0.91, RSS 0.92 y RSS 2.0.''%1': especifique la propiedad EditUri.2La longitud del contenido de la respuesta es cero.FNo se pueden cambiar las credenciales despu�s de enviar una solicitud.7Al elemento '%1' le falta el elemento '%2' obligatorio.7Al elemento '%1' le falta el atributo '%2' obligatorio.Falta el elemento ra�z '%1'.0El elemento '%1' no tiene elementos secundarios.Elemento duplicado '%1'.-Atributo '%1' inesperado en el elemento '%2'.OEste no es un valor de cadena. Use la propiedad ValueType para obtener el tipo.OEste no es un valor de n�mero. Use la propiedad ValueType para obtener el tipo.NEste no es un valor booleano. Use la propiedad ValueType para obtener el tipo.OEste no es un valor de matriz. Use la propiedad ValueType para obtener el tipo.OEste no es un valor de objeto. Use la propiedad ValueType para obtener el tipo.MPara obtener un valor de cadena de un objeto, use el m�todo GetNamedString().MPara obtener un valor de n�mero de un objeto, use el m�todo GetNamedNumber().MPara obtener un valor booleano de un objeto, use el m�todo GetNamedBoolean().LPara obtener un valor de matriz de un objeto, use el m�todo GetNamedArray().KPara obtener un valor de cadena de una matriz, use el m�todo GetStringAt().KPara obtener un valor de n�mero de una matriz, use el m�todo GetNumberAt().KPara obtener un valor booleano de una matriz, use el m�todo GetBooleanAt().KPara obtener un valor de objeto de una matriz, use el m�todo GetObjectAt().PAd00�
0#0PP�pp����G����м4API

AtomPub

JSON

Formatear

(AsyncOperation

HTTP

 Informaci�n

 API Entrar

,Salida de la API

HInicio de operaci�n asincr�nica

TFinalizaci�n de operaci�n asincr�nica

HError de operaci�n asincr�nica

PAnulaci�n de operaci�n asincr�nica

HCierre de operaci�n asincr�nica

TFinalizaci�n de operaci�n asincr�nica

LProgreso de operaci�n asincr�nica

(Operaci�n HTTP

HAnalizar documento de categor�a

HComprobar elemento obligatorio

HComprobar atributo obligatorio

DComprobar elemento duplicado

$Analizar Uri

PAnalizar secuencia de fecha y hora

(Analizar entero

$Analizar XML

LComprobar atributo personalizado

LComprobar elemento personalizado

8Analizar secuencia JSON

DAgregar valor predeterminado

4Agregar primer valor

@Omitir contenido inesperado

HAgregar atributo personalizado

HAgregar elemento personalizado

Error

 Advertencia

 Informaci�n

Detallado

API

Analizar

 Serializar

(E/S asincr�nico

LMicrosoft-Windows-Runtime-WebAPI

dSe inici� la operaci�n asincr�nica %1 en %2.

�La operaci�n asincr�nica %1 en %2 no pudo iniciarse. El c�digo de error es %3: %4

|La operaci�n asincr�nica %1 en %2 finaliz� correctamente.

�Error de operaci�n asincr�nica %1 en %2. C�digo de error %3: %4.

dSe cancel� la operaci�n asincr�nica %1 en %2.

`Se cerr� la operaci�n asincr�nica %1 en %2.

�La operaci�n asincr�nica %1 en %2 llam� a la devoluci�n de llamada de finalizaci�n en %3.

�La operaci�n asincr�nica %1 en %2 llam� a la devoluci�n de llamada de progreso en %3.

�La operaci�n asincr�nica %1 en %2 no pudo quitar el identificador de GIT. El c�digo de error es %3: %4

�La operaci�n asincr�nica %1 en %2 no pudo registrar el identificador en GIT. El c�digo de error es %3: %4

�La operaci�n asincr�nica %1 en %2 no pudo recuperar el identificador desde GIT. El c�digo de error es %3: %4

HError al analizar el Uri '%1'.

�Error al crear el Uri con el Uri '%1' de base y el Uri '%2' relativo.

LAgregar encabezado HTTP '%1: %2'.

lIniciar conexi�n con '%1' con credencial de '%2'.

|Iniciar conexi�n con '%1' con credencial predeterminada.

�Error al conectar con '%1' en el puerto %2. El �ltimo error es %3: %4

tAbriendo solicitud para '%1' para '%2' con marcas %3.

�No pudo abrirse la solicitud para '%1'. El �ltimo error es %2: %3

�El contexto de solicitud %1 tiene el identificador de solicitud %2 para '%3'.

�Establezca el tiempo de espera de recepci�n y env�o de HTTP en %2ms en el identificador de solicitud %1.

�Inicie el env�o del identificador de solicitud %1 con una longitud de contenido %2.

�Identificador de solicitud %1 completado de forma sincr�nica.

�El identificador de solicitud %1 complet� el env�o de forma asincr�nica.

�Escribiendo %2 bytes para el identificador de solicitud %1.

�No pudo enviarse el cuerpo de la entidad al identificador de solicitud %1. El �ltimo error es %2: %3

�Se env�o la solicitud HTTP en el identificador de solicitud %1: %2

�Comience a recibir respuesta del identificador de solicitud %1.

Se recibi� respuesta HTTP desde el identificador de solicitud %1 con el c�digo de estado %2 y la descripci�n de estado '%3'.

�Reciba respuesta HTTP desde el identificador de solicitud %1: %2

�No pudo recibirse respuesta HTTP desde el identificador de solicitud %1. El �ltimo error es %2: %3

�El contexto de respuesta %1 recibi� respuesta HTTP de %2 bytes, que supera el l�mite de %3.

pContexto de solicitud %1 que reenv�a la solicitud.

�Reutilizando el identificador de solicitud %1 para el servidor '%2'.

TSe anul� el contexto de solicitud %1.

�Pasar a '%1': %2 bytes enviados; %3 total de bytes por enviar; %4 bytes recibidos; %5 total de bytes por recibir.

�Solicitud HTTP para '%1' completada. El c�digo de error es %2: %3

�La operaci�n asincr�nica %1 en %2 no pudo procesar la respuesta HTTP '%3'. El c�digo de error es %4: %5

0Se llama a %1::%2.

LSe devolvi� %1::%2 correctamente.

PError de %1::%2 con HRESULT %3: %4

pIniciar descarga de documento de categor�a en'%1'.

tDescarga de documento de categor�a correcta en '%1'.

�No pudo descargarse el documento de categor�a en '%1'. El c�digo de error es %2: %3

�No pudo descargarse el documento de categor�a en '%1'. El c�digo de estado HTTP fue %2.

�No pudo analizarse el documento de categor�a descargado desde '%1'. El c�digo de error es %2: %3.

PFalta el elemento '%1' obligatorio.

xFalta el atributo '%1' obligatorio en el elemento '%2'.

XSe encontr� el elemento duplicado '%1'.

�Falta el elemento '%1' obligatorio. Agregue uno con valor predeterminado.

�Falta el atributo '%1' obligatorio en el elemento '%2'. Agr�guelo con valor vac�o.

�El elemento analizado 'feed' no tiene ning�n elemento 'author'.

�Se encuentran varios elementos '%1'. Use el primero y omita el resto.

�Omita el elemento 'entry' encontrado en el elemento 'source'.

�El elemento 'entry' no tiene un elemento 'content' ni un elemento 'link' con rel='alternate'. XML de elemento: %1

�Al elemento 'item' le faltan los elementos 'title' y 'description'. XML de elemento: %1

�Al elemento 'link' con rel='enclosure' le falta el atributo 'length'. XML de elemento: %1

�Se encontr� un elemento secundario inesperado en el elemento con XML: %1

�Atributo 'type' inesperado '%1' cuando est� presente el atributo 'src'. XML de elemento: %2

Atributo 'type' inesperado '%1' en contenido de texto Atom. Solamente se permite 'text', 'html' o 'xhtml'. XML de elemento: %2

�El elemento '%1' no debe contener ning�n texto o elemento secundario. XML de elemento: %2

0El contenido de texto Atom con type='xhtml' debe tener un �nico elemento secundario 'div' en el espacio de nombres 'http://www.w3.org/1999/xhtml'.

XNo pudo analizarse la fecha hora '%1'.

PNo pudo analizarse el entero '%1'.

XNo pudo analizarse el documento: '%1'.

�No pudo crearse el nodo de atributo. El atributo '%1' en el espacio de nombres '%2' no es un atributo XML v�lido.

�No pudo crearse el elemento de nodo. El elemento '%1' en el espacio de nombres '%2' no es un elemento XML v�lido.

�Error al agregar el atributo '%1' en el espacio de nombres '%2' en el elemento. Esto probablemente se deba a un conflicto de espacio de nombres y puede resolverse configurando un prefijo de espacio de nombres diferente en el nombre del atributo.

�Error al analizar la secuencia JSON '%1'. El error se produjo cerca de %2.

�La secuencia JSON super� la profundidad m�xima permitida %1.

TIdentificador %1: HTTP/2 habilitado.

4SyndicationAttribute

DISyndicationAttributeFactory

(SyndicationNode

8ISyndicationNodeFactory

4SyndicationGenerator

DISyndicationGeneratorFactory

(SyndicationText

8ISyndicationTextFactory

0SyndicationContent

@ISyndicationContentFactory

(SyndicationLink

8ISyndicationLinkFactory

,SyndicationPerson

<ISyndicationPersonFactory

0SyndicationCategory

@ISyndicationCategoryFactory

(SyndicationItem

8ISyndicationItemFactory

(SyndicationFeed

8ISyndicationFeedFactory

4RetrieveFeedOperation

,SyndicationClient

<ISyndicationClientFactory

JsonValue

 JsonObject

0IJsonObjectFactory

JsonArray

,IJsonArrayFactory

0ResourceCollection

Workspace

(ServiceDocument

LRetrieveServiceDocumentOperation

8CreateResourceOperation

<RetrieveResourceOperation

8UpdateResourceOperation

8DeleteResourceOperation

HRetrieveMediaResourceOperation

$AtomPubClient

4IAtomPubClientFactory

get_Name

put_Name

$get_Namespace

$put_Namespace

get_Value

put_Value

@CreateSyndicationAttribute

$get_NodeName

$put_NodeName

,get_NodeNamespace

,put_NodeNamespace

$get_NodeValue

$put_NodeValue

$get_Language

$put_Language

 get_BaseUri

 put_BaseUri

8get_AttributeExtensions

4get_ElementExtensions

(GetXmlDocument

4CreateSyndicationNode

get_Text

put_Text

get_Uri

put_Uri

 get_Version

 put_Version

@CreateSyndicationGenerator

get_Type

put_Type

get_Xml

put_Xml

ToString

4CreateSyndicationText

8CreateSyndicationTextEx

$get_SourceUri

$put_SourceUri

<CreateSyndicationContent

TCreateSyndicationContentWithSourceUri

 get_Length

 put_Length

$get_MediaType

$put_MediaType

,get_Relationship

,put_Relationship

get_Title

put_Title

4get_ResourceLanguage

4put_ResourceLanguage

4CreateSyndicationLink

8CreateSyndicationLinkEx

get_Email

put_Email

8CreateSyndicationPerson

<CreateSyndicationPersonEx

get_Label

put_Label

 get_Scheme

 put_Scheme

get_Term

put_Term

<CreateSyndicationCategory

@CreateSyndicationCategoryEx

 get_Authors

(get_Categories

,get_Contributors

 get_Content

 put_Content

get_Id

put_Id

0get_LastUpdatedTime

0put_LastUpdatedTime

get_Links

,get_PublishedDate

,put_PublishedDate

 get_Rights

 put_Rights

 get_Source

 put_Source

 get_Summary

 put_Summary

(get_CommentsUri

(put_CommentsUri

 get_EditUri

,get_EditMediaUri

get_ETag

 get_FeedUri

 get_ItemUri

Load

 LoadFromXml

4CreateSyndicationItem

$get_Generator

$put_Generator

 get_IconUri

 put_IconUri

get_Items

$get_ImageUri

$put_ImageUri

$get_Subtitle

$put_Subtitle

$get_FirstUri

 get_LastUri

 get_NextUri

(get_PreviousUri

,get_SourceFormat

4CreateSyndicationFeed

$put_Progress

$get_Progress

$put_Completed

$get_Completed

 GetResults

4get_ServerCredential

4put_ServerCredential

0get_ProxyCredential

0put_ProxyCredential

<get_MaxResponseBufferSize

<put_MaxResponseBufferSize

 get_Timeout

 put_Timeout

<get_BypassCacheOnRetrieve

<put_BypassCacheOnRetrieve

,SetRequestHeader

,RetrieveFeedAsync

8CreateSyndicationClient

$get_ValueType

Parse

Stringify

GetString

GetNumber

 GetBoolean

GetArray

GetObject

0CreateBooleanValue

,CreateNumberValue

,CreateStringValue

$GetNamedValue

$SetNamedValue

(GetNamedObject

$GetNamedArray

(GetNamedString

(GetNamedNumber

(GetNamedBoolean

,CreateJsonObject

 GetObjectAt

 GetArrayAt

 GetStringAt

 GetNumberAt

$GetBooleanAt

(CreateJsonArray

 get_Accepts

(get_Collections

(get_Workspaces

DRetrieveServiceDocumentAsync

@RetrieveMediaResourceAsync

4RetrieveResourceAsync

0CreateResourceAsync

<CreateMediaResourceAsync

<UpdateMediaResourceAsync

0UpdateResourceAsync

8UpdateResourceItemAsync

0DeleteResourceAsync

8DeleteResourceItemAsync

4CancelAsyncOperations

PCreateAtomPubClientWithCredentials

First

GetAt

get_Size

GetView

IndexOf

SetAt

InsertAt

Insert

RemoveAt

Remove

Append

 RemoveAtEnd

Clear

Lookup

HasKey

TryParse

8GetNamedValueOrDefault

8GetNamedObjectOrDefault

8GetNamedArrayOrDefault

8GetNamedStringOrDefault

8GetNamedNumberOrDefault

<GetNamedBooleanOrDefault

(CreateNullValue

DUpdateMediaResourceOperation

�4VS_VERSION_INFO��
aJ
aJ?StringFileInfo�0C0A04B0LCompanyNameMicrosoft CorporationNFileDescriptionDLL de cliente webh$FileVersion10.0.19041.1 (WinBuild.160101.0800)>InternalNameWeb Client DLL�8LegalCopyright� Microsoft Corporation. Todos los derechos reservados.POriginalFilenameWindows.Web.dll.MUIl&ProductNameSistema operativo Microsoft� Windows�>
ProductVersion10.0.19041.1DVarFileInfo$Translation
�<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:atom03="http://purl.org/atom/ns#" xmlns:msfeednorm="urn:microsoft:feed-normalization" exclude-result-prefixes="sy atom03 msfeednorm">

<!-- Shared templates -->
  <xsl:import href="res://msfeeds.dll/SharedNormalizer.xsl"/>

<!-- Output XML UTF-8 -->
  <xsl:output method="xml" encoding="utf-8"/>
  
<!-- Entry point -->
  <xsl:template match="/atom03:feed">
    <rss version="2.0">
      <channel>

        <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:call-template name="_OutputLanguage"><xsl:with-param name="value" select="@xml:lang"/></xsl:call-template>

        <!-- 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>

        <!-- Try to find the main link - one that has an href pointing to html and with type alternate -->
        <xsl:variable name="mainLink" select="atom03:link[(@rel = 'alternate' or @rel = '' or not(@rel)) and (@type = 'text/html' or @type = '' or not(@type))]"/>

        <!-- Output link -->
        <xsl:if test="$mainLink">
          <!-- Combine base URL with the main link -->
          <xsl:variable name="channelLinkUrl">
            <xsl:call-template name="_CompleteUrlTwoBase">
              <xsl:with-param name="baseUrl1" select="$baseChannelUrl"/>
              <xsl:with-param name="baseUrl2" select="$mainLink/@xml:base"/>
              <xsl:with-param name="Url" select="$mainLink/@href"/>
            </xsl:call-template>
          </xsl:variable>
          <xsl:call-template name="_OutputLink"><xsl:with-param name="value" select="$channelLinkUrl"/></xsl:call-template>
        </xsl:if>

        <!-- 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="atom03:entry">
          <xsl:with-param name="baseChannelUrl" select="$baseChannelUrl"/>
          <xsl:with-param name="references" select="$cfReferences"/>
        </xsl:apply-templates>

      </channel>
    </rss>
  </xsl:template>

<!-- Channel processing -->
  <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(.) = $_NSatom03 and local-name(.) = 'title' and $isFirst = 'true'">
        <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(.) = $_NSatom03 and local-name(.) = 'author'">
        <!-- First one gets converted to managing Editor -->
        <xsl:if test="$isFirst = 'true'">
          <xsl:variable name="manEditor">
            <xsl:call-template name="_ConvertAtomAuthorToAuthor">
              <xsl:with-param name="name" select="atom03:name"/>
              <xsl:with-param name="email" select="atom03:email"/>
            </xsl:call-template>
          </xsl:variable>
          <xsl:call-template name="_OutputManagingEditor"><xsl:with-param name="value" select="$manEditor"/></xsl:call-template>
        </xsl:if>
        <!-- Map to Atom 1.0 -->
        <xsl:call-template name="_OutputAtomAuthor">
          <xsl:with-param name="name" select="atom03:name"/>
          <xsl:with-param name="email" select="atom03:email"/>
          <xsl:with-param name="uri" select="atom03:url"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSatom03 and local-name(.) = 'contributor'">
        <!-- Map to Atom 1.0 -->
        <xsl:call-template name="_OutputAtomContributor">
          <xsl:with-param name="name" select="atom03:name"/>
          <xsl:with-param name="email" select="atom03:email"/>
          <xsl:with-param name="uri" select="atom03:url"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSatom03 and local-name(.) = 'tagline' and $isFirst = 'true'">
        <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(.) = $_NSatom03 and local-name(.) = 'id' and $isFirst = 'true'">
        <xsl:call-template name="_OutputGuid">
          <xsl:with-param name="value" select="."/>
          <xsl:with-param name="isPermaLink" select="'false'"/>
          <xsl:with-param name="channelGuid" select="'true'"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSatom03 and local-name(.) = 'generator' and $isFirst = 'true'">
        <xsl:call-template name="_OutputGenerator">
          <xsl:with-param name="value" select="."/>
          <xsl:with-param name="uri" select="@url"/>
          <xsl:with-param name="version" select="@version"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSatom03 and local-name(.) = 'modified' and $isFirst = 'true'">
        <xsl:call-template name="_OutputLastBuildDate"><xsl:with-param name="value" select="."/></xsl:call-template>
        <xsl:variable name="updatedExists">
          <xsl:choose>
            <xsl:when test="../atom:updated">true</xsl:when>
            <xsl:otherwise>false</xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <xsl:if test="$updatedExists = 'false'">
          <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: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(../atom03:modified)">
            <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(.) = $_NSatom03 and local-name(.) = 'copyright' and $isFirst = 'true'">
        <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(.) = $_NSdc and local-name(.) = 'subject'">
        <xsl:call-template name="_OutputCategory"><xsl:with-param name="value" select="."/></xsl:call-template>
      </xsl:when>
      <!-- First pair of updateFrequency and updatePeriod gets converted to ttl; all sy:* nodes are preserved as extensions -->
      <xsl:when test="namespace-uri(.) = $_NSsy and local-name(.) = 'updatePeriod' and $isFirst = 'true'">
        <xsl:if test="../sy:updateFrequency">
          <xsl:call-template name="_ConvertUpdatesToTtl">
            <xsl:with-param name="updatePeriod" select="string(.)"/>
            <xsl:with-param name="updateFrequency" select="string(../sy:updateFrequency)"/>
          </xsl:call-template>
          <xsl:call-template name="_OutputExtension"><xsl:with-param name="value" select="."/></xsl:call-template>
        </xsl:if>
      </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(.) = $_NSatom03 and local-name(.) = 'entry'">
        <!-- Do nothing here for items -->
      </xsl:when>
      <!-- Copy extension nodes -->
      <xsl:when test="namespace-uri(.) != $_NSatom03 and 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="atom03:entry">
    <xsl:param name="baseChannelUrl"/>
    <xsl:param name="references"/>
    <item>

      <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>

      <!-- Try to find the main link - one that has an href pointing to html and with type alternate -->
      <xsl:variable name="mainLink" select="atom03:link[(@rel = 'alternate' or @rel = '' or not(@rel)) and (@type = 'text/html' or @type = '' or not(@type))]"/>

      <!-- Output link -->
      <xsl:if test="$mainLink">
        <!-- Combine base URL with the main link -->
        <xsl:variable name="itemLinkUrl">
          <xsl:call-template name="_CompleteUrlTwoBase">
            <xsl:with-param name="baseUrl1" select="$baseChannelItemUrl"/>
            <xsl:with-param name="baseUrl2" select="$mainLink/@xml:base"/>
            <xsl:with-param name="Url" select="$mainLink/@href"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:call-template name="_OutputLink"><xsl:with-param name="value" select="$itemLinkUrl"/></xsl:call-template>
      </xsl:if>

      <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(.) = $_NSatom03 and local-name(.) = 'title' and $isFirst = 'true'">
        <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(.) = $_NSatom03 and local-name(.) = 'link' and @rel = 'enclosure' and (@href or @length or @type)">
        <xsl:variable name="enclosureUrl">
          <xsl:call-template name="_CompleteUrlTwoBase">
            <xsl:with-param name="baseUrl1" select="$baseItemUrl"/>
            <xsl:with-param name="baseUrl2" select="@xml:base"/>
            <xsl:with-param name="Url" select="@href"/>
          </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(.) = $_NSatom03 and local-name(.) = 'author'">
        <xsl:variable name="author">
          <xsl:call-template name="_ConvertAtomAuthorToAuthor">
            <xsl:with-param name="name" select="atom03:name"/>
            <xsl:with-param name="email" select="atom03:email"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:call-template name="_OutputAuthor"><xsl:with-param name="value" select="$author"/></xsl:call-template>
        <!-- Map to Atom 1.0 -->
        <xsl:call-template name="_OutputAtomAuthor">
          <xsl:with-param name="name" select="atom03:name"/>
          <xsl:with-param name="email" select="atom03:email"/>
          <xsl:with-param name="uri" select="atom03:url"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSatom03 and local-name(.) = 'contributor'">
        <!-- Map to Atom 1.0 -->
        <xsl:call-template name="_OutputAtomContributor">
          <xsl:with-param name="name" select="atom03:name"/>
          <xsl:with-param name="email" select="atom03:email"/>
          <xsl:with-param name="uri" select="atom03:url"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSatom03 and local-name(.) = 'id' and $isFirst = 'true'">
        <xsl:call-template name="_OutputGuid">
          <xsl:with-param name="value" select="."/>
          <xsl:with-param name="isPermaLink" select="'false'"/>
        </xsl:call-template>
      </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(../atom03:issued)">
            <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(.) = $_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(.) = $_NSatom03 and local-name(.) = 'modified' and $isFirst = 'true'">
        <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(.) = $_NSatom03 and local-name(.) = 'issued' and $isFirst = 'true'">
        <xsl:call-template name="_OutputPubDate"><xsl:with-param name="value" select="."/></xsl:call-template>
        <xsl:if test="not(../atom:updated) and not(../atom03:modified)">
          <xsl:call-template name="_OutputAtomUpdated"><xsl:with-param name="value" select="."/></xsl:call-template>
        </xsl:if>
        <xsl:if test="not(../atom:published)">
          <xsl:call-template name="_OutputAtomPublished"><xsl:with-param name="value" select="."/></xsl:call-template>
        </xsl:if>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSdc and local-name(.) = 'subject'">
        <xsl:call-template name="_OutputCategory"><xsl:with-param name="value" select="."/></xsl:call-template>
      </xsl:when>
      <!-- Handle content: printable goes into description; non-printable is preserved -->
      <xsl:when test="namespace-uri(.) = $_NSatom03 and local-name(.) = 'content' and $isFirst = 'true'">
          <xsl:if test="@type = '' or not(@type) or @type = 'text/plain' or @type = 'text/html' or @type = 'application/xhtml+xml'">
            <xsl:variable name="baseContentUrl">
              <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="$baseContentUrl"/>
            </xsl:call-template>
          </xsl:if>
      </xsl:when>
      <!-- Handle summary: printable goes into description or atom:summary; non-printable is discarded -->
      <xsl:when test="namespace-uri(.) = $_NSatom03 and local-name(.) = 'summary' and $isFirst = 'true'">
        <xsl:if test="@type = '' or not(@type) or @type = 'text/plain' or @type = 'text/html' or @type = 'application/xhtml+xml'">
          <xsl:variable name="baseContentUrl">
            <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:choose>
            <xsl:when test="not(../atom03:content[@type = '' or not(@type) or @type = 'text/plain' or @type = 'text/html' or @type = 'application/xhtml+xml'])">
              <xsl:call-template name="_OutputDescription">
                <xsl:with-param name="value" select="."/>
                <xsl:with-param name="type" select="@type"/>
                <xsl:with-param name="baseUrl" select="$baseContentUrl"/>
              </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
              <!-- Map to Atom 1.0 -->
              <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="$baseContentUrl"/>
              </xsl:call-template>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:if>
      </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="_CompleteUrlTwoBase">
              <xsl:with-param name="baseUrl1" select="$baseItemUrl"/>
              <xsl:with-param name="baseUrl2" select="@xml:base"/>
              <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>
      <xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'link'">
        <!-- Special handling for item level atom:link with rel=entry-content: complete relative URL -->
        <xsl:variable name="atomLinkUrl">
          <xsl:choose>
            <xsl:when test="@rel = 'entry-content'">
              <xsl:call-template name="_CombineUrls">
                <xsl:with-param name="baseUrl" select="$baseItemUrl"/>
                <xsl:with-param name="relUrl" select="@href"/>
              </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="@href"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <xsl:call-template name="_OutputAtomLink">
          <xsl:with-param name="href" select="$atomLinkUrl"/>
          <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>
      <!-- Copy extension nodes -->
      <xsl:when test="namespace-uri(.) != $_NSatom03 and 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>
PAD<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:msfeednorm="urn:microsoft:feed-normalization" exclude-result-prefixes="sy msfeednorm">

<!-- Shared templates -->
  <xsl:import href="res://msfeeds.dll/SharedNormalizer.xsl"/>

<!-- Output XML UTF-8 -->
  <xsl:output method="xml" encoding="utf-8"/>

<!-- Entry point -->
  <xsl:template match="/atom:feed">
    <rss version="2.0">
      <channel>

        <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:call-template name="_OutputLanguage"><xsl:with-param name="value" select="@xml:lang"/></xsl:call-template>

        <!-- 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>

        <!-- Try to find the main link - one that has an href pointing to html and with type alternate -->
        <xsl:variable name="mainLink" select="atom:link[(@rel = 'alternate' or @rel = '' or not(@rel)) and (@type = 'text/html' or @type = '' or not(@type))]"/>

        <!-- Combine base URL with the main link -->
        <xsl:variable name="channelLinkUrl">
          <xsl:call-template name="_CompleteUrlTwoBase">
            <xsl:with-param name="baseUrl1" select="$baseChannelUrl"/>
            <xsl:with-param name="baseUrl2" select="$mainLink/@xml:base"/>
            <xsl:with-param name="Url" select="$mainLink/@href"/>
          </xsl:call-template>
        </xsl:variable>

        <xsl:if test="$mainLink">
          <xsl:call-template name="_OutputLink"><xsl:with-param name="value" select="$channelLinkUrl"/></xsl:call-template>
        </xsl:if>

        <xsl:if test="atom:logo">
          <xsl:variable name="logoImageUrl">
            <xsl:call-template name="_CompleteUrlTwoBase">
              <xsl:with-param name="baseUrl1" select="$baseChannelUrl"/>
              <xsl:with-param name="baseUrl2" select="atom:logo/@xml:base"/>
              <xsl:with-param name="Url" select="atom:logo"/>
            </xsl:call-template>
          </xsl:variable>
          <xsl:call-template name="_OutputImage">
            <xsl:with-param name="url" select="$logoImageUrl"/>
            <xsl:with-param name="title" select="atom:title"/>
            <xsl:with-param name="titleType" select="atom:title/@type"/>
            <xsl:with-param name="link" select="$channelLinkUrl"/>
          </xsl:call-template>
        </xsl:if>

        <!-- 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>

        <xsl:apply-templates select="*" mode="channel">
          <xsl:with-param name="baseChannelUrl" select="$baseChannelUrl"/>
        </xsl:apply-templates>

        <xsl:apply-templates select="atom:entry">
          <xsl:with-param name="baseChannelUrl" select="$baseChannelUrl"/>
          <xsl:with-param name="references" select="$cfReferences"/>
        </xsl:apply-templates>

      </channel>
    </rss>
  </xsl:template>

<!-- Channel processing -->
  <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(.) = $_NSatom1 and local-name(.) = 'updated'">
        <xsl:if test="$isFirst = 'true'">
          <xsl:call-template name="_OutputAtomUpdated"><xsl:with-param name="value" select="."/><xsl:with-param name="type" select="@type"/></xsl:call-template>
          <xsl:call-template name="_OutputLastBuildDate"><xsl:with-param name="value" select="."/><xsl:with-param name="type" select="@type"/></xsl:call-template>
        </xsl:if>
        
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'title' and $isFirst = 'true'">
        <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(.) = $_NSatom1 and local-name(.) = 'author'">
        <!-- First one gets converted to managing Editor -->
        <xsl:if test="$isFirst = 'true'">
          <xsl:variable name="manEditor">
            <xsl:call-template name="_ConvertAtomAuthorToAuthor">
              <xsl:with-param name="name" select="atom:name"/>
              <xsl:with-param name="email" select="atom:email"/>
            </xsl:call-template>
          </xsl:variable>
          <xsl:call-template name="_OutputManagingEditor"><xsl:with-param name="value" select="$manEditor"/></xsl:call-template>
        </xsl:if>
        <!-- We also make a full copy of every atom: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(.) = $_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(.) = $_NSatom1 and local-name(.) = 'subtitle' and $isFirst = 'true'">
        <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(.) = $_NSatom1 and local-name(.) = 'id' and $isFirst = 'true'">
        <xsl:call-template name="_OutputGuid">
          <xsl:with-param name="value" select="."/>
          <xsl:with-param name="isPermaLink" select="'false'"/>
          <xsl:with-param name="channelGuid" select="'true'"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'generator' and $isFirst = 'true'">
        <xsl:call-template name="_OutputGenerator">
          <xsl:with-param name="value" select="."/>
          <xsl:with-param name="uri" select="@uri"/>
          <xsl:with-param name="version" select="@version"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'rights' and $isFirst = 'true'">
        <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(.) = $_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>
      <!-- First pair of updateFrequency and updatePeriod gets converted to ttl; all sy:* nodes are preserved as extensions -->
      <xsl:when test="namespace-uri(.) = $_NSsy and local-name(.) = 'updatePeriod' and $isFirst = 'true'">
        <xsl:if test="../sy:updateFrequency">
          <xsl:call-template name="_ConvertUpdatesToTtl">
            <xsl:with-param name="updatePeriod" select="string(.)"/>
            <xsl:with-param name="updateFrequency" select="string(../sy:updateFrequency)"/>
          </xsl:call-template>
        </xsl:if>
        <xsl:call-template name="_OutputExtension"><xsl:with-param name="value" select="."/></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(.) = $_NSatom1 and local-name(.) = 'entry'">
        <!-- Do nothing here for items -->
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSmon and local-name(.) = 'expiration'">
        <xsl:if test="$isFirst = 'true'">
          <xsl:call-template name="_OutputMonExpiration"><xsl:with-param name="value" select="."/><xsl:with-param name="type" select="@type"/></xsl:call-template>
        </xsl:if>
      </xsl:when>
      <!-- Copy extension nodes -->
      <xsl:when test="namespace-uri(.) != $_NSatom1 and 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="atom:entry">
    <xsl:param name="baseChannelUrl"/>
    <xsl:param name="references"/>
    <item>

      <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>

      <!-- Try to find the main link - one that has an href pointing to html and with type alternate -->
      <xsl:variable name="mainLink" select="atom:link[(@rel = 'alternate' or @rel = '' or not(@rel)) and (@type = 'text/html' or @type = '' or not(@type))]"/>

      <!-- Output link -->
      <xsl:if test="$mainLink">
        <!-- Combine base URL with the main link -->
        <xsl:variable name="itemLinkUrl">
          <xsl:call-template name="_CompleteUrlTwoBase">
            <xsl:with-param name="baseUrl1" select="$baseChannelItemUrl"/>
            <xsl:with-param name="baseUrl2" select="$mainLink/@xml:base"/>
            <xsl:with-param name="Url" select="$mainLink/@href"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:call-template name="_OutputLink"><xsl:with-param name="value" select="$itemLinkUrl"/></xsl:call-template>
      </xsl:if>

      <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>
      <!-- Process items -->
      <xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'title' and $isFirst = 'true'">
        <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(.) = $_NSatom1 and local-name(.) = 'link' and @rel = 'enclosure' and (@href or @length or @type)">
        <xsl:variable name="enclosureUrl">
          <xsl:call-template name="_CompleteUrlTwoBase">
            <xsl:with-param name="baseUrl1" select="$baseItemUrl"/>
            <xsl:with-param name="baseUrl2" select="@xml:base"/>
            <xsl:with-param name="Url" select="@href"/>
          </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>
        <!-- We also make a full copy of the atom: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(.) = 'link'">
        <!-- Special handling for item level atom:link with rel=entry-content: complete relative URL -->
        <xsl:variable name="atomLinkUrl">
          <xsl:choose>
            <xsl:when test="@rel = 'entry-content'">
              <xsl:call-template name="_CombineUrls">
                <xsl:with-param name="baseUrl" select="$baseItemUrl"/>
                <xsl:with-param name="relUrl" select="@href"/>
              </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="@href"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <xsl:call-template name="_OutputAtomLink">
          <xsl:with-param name="href" select="$atomLinkUrl"/>
          <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:variable name="author">
          <xsl:call-template name="_ConvertAtomAuthorToAuthor">
            <xsl:with-param name="name" select="atom:name"/>
            <xsl:with-param name="email" select="atom:email"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:call-template name="_OutputAuthor"><xsl:with-param name="value" select="$author"/></xsl:call-template>
        <!-- We also make a full copy of the atom: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(.) = $_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(.) = $_NSatom1 and local-name(.) = 'id' and $isFirst = 'true'">
        <xsl:call-template name="_OutputGuid">
          <xsl:with-param name="value" select="."/>
          <xsl:with-param name="isPermaLink" select="'false'"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'updated' and $isFirst = 'true'">
        <xsl:call-template name="_OutputAtomUpdated"><xsl:with-param name="value" select="."/></xsl:call-template>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'published' and $isFirst = 'true'">
        <xsl:call-template name="_OutputAtomPublished"><xsl:with-param name="value" select="."/></xsl:call-template>
        <xsl:call-template name="_OutputPubDate"><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(.) = $_NSatom1 and local-name(.) = 'category' and (@term or @scheme)">
        <xsl:call-template name="_OutputCategory">
          <xsl:with-param name="value" select="@term"/>
          <xsl:with-param name="domain" select="@scheme"/>
        </xsl:call-template>
      </xsl:when>
      <!-- Handle content: printable goes into description; non-printable is preserved -->
      <xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'content' and $isFirst = 'true'">
        <xsl:choose>
          <xsl:when test="(@src = '' or not(@src)) and (@type = '' or not(@type) or @type = 'text' or @type = 'html' or @type = 'xhtml')">
            <xsl:variable name="baseContentUrl">
              <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="$baseContentUrl"/>
            </xsl:call-template>
          </xsl:when>
          <xsl:otherwise>
            <!-- NOTE: We don't understand content so we just won't touch it -->
            <xsl:call-template name="_OutputExtension">
              <xsl:with-param name="value" select="."/>
            </xsl:call-template>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:when>
      <!-- Handle summary: printable goes into description or atom:summary; non-printable is discarded -->
      <xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'summary' and $isFirst = 'true'">
        <xsl:if test="(@src = '' or not(@src)) and (@type = '' or not(@type) or @type = 'text' or @type = 'html' or @type = 'xhtml')">
          <xsl:variable name="baseContentUrl">
            <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:choose>
            <xsl:when test="not(../atom:content[(@src = '' or not(@src)) and (@type = '' or not(@type) or @type = 'text' or @type = 'html' or @type = 'xhtml')])">
              <xsl:call-template name="_OutputDescription">
                <xsl:with-param name="value" select="."/>
                <xsl:with-param name="type" select="@type"/>
                <xsl:with-param name="baseUrl" select="$baseContentUrl"/>
              </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
              <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="$baseContentUrl"/>
              </xsl:call-template>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:if>
      </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="_CompleteUrlTwoBase">
              <xsl:with-param name="baseUrl1" select="$baseItemUrl"/>
              <xsl:with-param name="baseUrl2" select="@xml:base"/>
              <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(.) != $_NSatom1 and 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>
PA<?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:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rss="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:msfeednorm="urn:microsoft:feed-normalization" exclude-result-prefixes="content rdf rss dc dcterms sy msfeednorm">

<!-- Shared templates -->
  <xsl:import href="res://msfeeds.dll/SharedNormalizer.xsl"/>

<!-- Output XML UTF-8 -->
  <xsl:output method="xml" encoding="utf-8"/>

<!-- Entry point -->
  <xsl:template match="/rdf:RDF">
    <rss version="2.0">
      <channel>
        <!-- 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="rss:channel"/></xsl:call-template>
        </xsl:variable>

        <!-- Process feed elements -->
        <xsl:apply-templates select="rss:channel"/>
        <xsl:apply-templates select="rss:image"/>
        <xsl:apply-templates select="rss:textinput"/>
        <xsl:apply-templates select="rss:item">
          <xsl:with-param name="references" select="$cfReferences"/>
        </xsl:apply-templates>
      </channel>
    </rss>
  </xsl:template>

<!-- Channel processing -->
  <xsl:template match="rss:channel">
    <xsl:apply-templates select="*" mode="channel"/>
  </xsl:template>

  <xsl:template match="*" mode="channel">
    <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(.) = $_NSrss and local-name(.) = 'title' and $isFirst = 'true'">
        <xsl:call-template name="_OutputTitle"><xsl:with-param name="value" select="."/></xsl:call-template>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSrss and local-name(.) = 'link' and $isFirst = 'true'">
        <xsl:variable name="linkUrl">
          <xsl:call-template name="_CompleteUrl">
            <xsl:with-param name="baseUrl" select="$downloadUrl"/>
            <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(.) = $_NSrss and local-name(.) = 'description' and $isFirst = 'true'">
        <xsl:call-template name="_OutputTextDescription"><xsl:with-param name="value" select="."/></xsl:call-template>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSdc and local-name(.) = 'creator'">
        <xsl:if test="$isFirst = 'true'">
          <xsl:call-template name="_OutputManagingEditor">
            <xsl:with-param name="value" select="."/>
            <xsl:with-param name="convertToAtom" select="'true'"/>
          </xsl:call-template>
        </xsl:if>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSdc and local-name(.) = 'subject'">
        <xsl:call-template name="_OutputCategory"><xsl:with-param name="value" select="."/></xsl:call-template>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSdc and local-name(.) = 'publisher'">
        <xsl:if test="$isFirst = 'true'">
          <xsl:call-template name="_OutputWebMaster"><xsl:with-param name="value" select="."/></xsl:call-template>
        </xsl:if>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSdc and local-name(.) = 'language'">
        <xsl:if test="$isFirst = 'true'">
          <xsl:call-template name="_OutputLanguage"><xsl:with-param name="value" select="."/></xsl:call-template>
        </xsl:if>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSdc and local-name(.) = 'rights'">
        <xsl:if test="$isFirst = 'true'">
          <xsl:call-template name="_OutputCopyright"><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'">
          <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(.) = $_NSdc and local-name(.) = 'date'">
        <xsl:if test="$isFirst = 'true'">
          <xsl:call-template name="_OutputPubDate"><xsl:with-param name="value" select="."/></xsl:call-template>
          <xsl:if test="not(../dcterms:modified)">
            <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:if>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSdcterms and local-name(.) = 'available'">
        <xsl:if test="$isFirst = 'true' and not(../dc:date) and not(../dcterms:modified)">
          <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(.) = $_NSdcterms and local-name(.) = 'issued'">
        <xsl:if test="$isFirst = 'true' and not(../dc:date) and not(../dcterms:available) and not(../dcterms:modified)">
          <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(../dc:date) and not(../dcterms:available) and not(../dcterms:modified) and not(../dcterms:issued)">
            <xsl:call-template name="_OutputLastBuildDate"><xsl:with-param name="value" select="."/></xsl:call-template>
          </xsl:if>
        </xsl:if>

      </xsl:when>
      <!-- First pair of updateFrequency and updatePeriod gets converted to ttl; all sy:* nodes are preserved as extensions -->
      <xsl:when test="namespace-uri(.) = $_NSsy and local-name(.) = 'updatePeriod' and $isFirst = 'true'">
        <xsl:if test="../sy:updateFrequency">
          <xsl:call-template name="_ConvertUpdatesToTtl">
            <xsl:with-param name="updatePeriod" select="string(.)"/>
            <xsl:with-param name="updateFrequency" select="string(../sy:updateFrequency)"/>
          </xsl:call-template>
        </xsl:if>
        <xsl:call-template name="_OutputExtension"><xsl:with-param name="value" select="."/></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>
      <!-- Copy extension nodes -->
      <xsl:when test="namespace-uri(.) != $_NSrss and namespace-uri(.) != ''">
        <xsl:call-template name="_OutputExtension"><xsl:with-param name="value" select="."/></xsl:call-template>
      </xsl:when>
    </xsl:choose>
  </xsl:template>

<!-- Image processing -->
  <xsl:template match="rss:image">
    <xsl:if test="position() = 1">
      <xsl:variable name="imageUrl">
        <xsl:call-template name="_CompleteUrl">
          <xsl:with-param name="baseUrl" select="$downloadUrl"/>
          <xsl:with-param name="Url" select="rss:url"/>
        </xsl:call-template>
      </xsl:variable>
      <xsl:variable name="imageLink">
        <xsl:call-template name="_CompleteUrl">
          <xsl:with-param name="baseUrl" select="$downloadUrl"/>
          <xsl:with-param name="Url" select="rss:link"/>
        </xsl:call-template>
      </xsl:variable>
      <xsl:call-template name="_OutputImage">
        <xsl:with-param name="url" select="$imageUrl"/>
        <xsl:with-param name="title" select="rss:title"/>
        <xsl:with-param name="link" select="$imageLink"/>
        <xsl:with-param name="subnodesToCopy" select="*[namespace-uri(.) != $_NSrss and namespace-uri(.) != '']"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>

<!-- Text Input processing -->
  <xsl:template match="rss:textinput">
    <xsl:if test="position() = 1">
      <xsl:variable name="linkUrl">
        <xsl:call-template name="_CompleteUrl">
          <xsl:with-param name="baseUrl" select="$downloadUrl"/>
          <xsl:with-param name="Url" select="rss:link"/>
        </xsl:call-template>
      </xsl:variable>
      <xsl:call-template name="_OutputTextInput">
        <xsl:with-param name="title" select="rss:title"/>
        <xsl:with-param name="name" select="rss:name"/>
        <xsl:with-param name="link" select="$linkUrl"/>
        <xsl:with-param name="description" select="rss:description"/>
        <xsl:with-param name="subnodesToCopy" select="*[namespace-uri(.) != $_NSrss and namespace-uri(.) != '']"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>

<!-- Item processing -->
  <xsl:template match="rss:item">
    <xsl:param name="references"/>
    <item>
      <xsl:call-template name="_OutputXmlLang"><xsl:with-param name="value" select="@xml:lang"/></xsl:call-template>

      <xsl:apply-templates select="* | @*" mode="item">
        <xsl:with-param name="references" select="$references"/>
      </xsl:apply-templates>
    </item>
  </xsl:template>

  <xsl:template match="*" mode="item">
    <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(.) = $_NSrss and local-name(.) = 'title' and $isFirst = 'true'">
        <xsl:call-template name="_OutputTitle"><xsl:with-param name="value" select="."/></xsl:call-template>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSrss and local-name(.) = 'link' and $isFirst = 'true'">
        <xsl:variable name="linkUrl">
          <xsl:call-template name="_CompleteUrl">
            <xsl:with-param name="baseUrl" select="$downloadUrl"/>
            <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(.) = $_NSdc and local-name(.) = 'creator'">
          <xsl:call-template name="_OutputAuthor">
            <xsl:with-param name="value" select="."/>
            <xsl:with-param name="convertToAtom" select="'true'"/>
          </xsl:call-template>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSdc and local-name(.) = 'subject'">
        <xsl:call-template name="_OutputCategory"><xsl:with-param name="value" select="."/></xsl:call-template>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSdc and local-name(.) = 'date'">
        <xsl:if test="$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: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(../dc:date)">
            <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(.) = $_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(.) = $_NSdcterms and local-name(.) = 'modified'">
        <xsl:if test="$isFirst = 'true'">
          <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(.) = $_NScontent and local-name(.) = 'encoded'">
        <xsl:if test="$isFirst = 'true'">
          <xsl:call-template name="_OutputDescriptionAndSummary">
            <xsl:with-param name="description" select="."/>
            <xsl:with-param name="descriptionType" select="'html'"/>
            <xsl:with-param name="descriptionBaseUrl" select="$downloadUrl"/>
            <xsl:with-param name="summary" select="../rss:description"/>
            <xsl:with-param name="summaryType" select="'html'"/>
            <xsl:with-param name="summaryBaseUrl" select="$downloadUrl"/>
          </xsl:call-template>
        </xsl:if>
      </xsl:when>
      <xsl:when test="namespace-uri(.) = $_NSrss and local-name(.) = 'description' and $isFirst = 'true'">
        <xsl:if test="not(../content:encoded)">
          <xsl:call-template name="_OutputDescription">
            <xsl:with-param name="value" select="."/>
            <xsl:with-param name="type" select="'html'"/>
            <xsl:with-param name="baseUrl" select="$downloadUrl"/>
          </xsl:call-template>
        </xsl:if>
      </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="$downloadUrl"/>
              <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>
      <xsl:when test="namespace-uri(.) = $_NSatom1 and local-name(.) = 'link'">
        <!-- Special handling for item level atom:link with rel=entry-content: complete relative URL -->
        <xsl:variable name="atomLinkUrl">
          <xsl:choose>
            <xsl:when test="@rel = 'entry-content'">
              <xsl:call-template name="_CombineUrls">
                <xsl:with-param name="baseUrl" select="$downloadUrl"/>
                <xsl:with-param name="relUrl" select="@href"/>
              </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="@href"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <xsl:call-template name="_OutputAtomLink">
          <xsl:with-param name="href" select="$atomLinkUrl"/>
          <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>
      <!-- Copy extension nodes -->
      <xsl:when test="namespace-uri(.) != $_NSrss and 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:template match="@*" mode="item">
    <!-- No need to check if first, because XML doesn't allow duplicate attributes -->
    <xsl:if test="namespace-uri(.) = $_NSrdf and local-name(.) = 'about'">
      <xsl:call-template name="_OutputGuid">
        <xsl:with-param name="value" select="."/>
        <xsl:with-param name="isPermaLink" select="'false'"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>

</xsl:stylesheet>
PAD<?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>no válido</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'">
        <!-- Special handling for item level atom:link with rel=entry-content: complete relative URL -->
        <xsl:variable name="atomLinkUrl">
          <xsl:choose>
            <xsl:when test="@rel = 'entry-content'">
              <xsl:call-template name="_CombineUrls">
                <xsl:with-param name="baseUrl" select="$baseItemUrl"/>
                <xsl:with-param name="relUrl" select="@href"/>
              </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="@href"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <xsl:call-template name="_OutputAtomLink">
          <xsl:with-param name="href" select="$atomLinkUrl"/>
          <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>
<?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:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:msfeednorm="urn:microsoft:feed-normalization" exclude-result-prefixes="msfeednorm">

<!-- IMPORTANT: This shared XSL gets imported using our code by copying all the xsl:stylesheet's children, 
so all of the above namespace declarations must be present in each other XSL where this is imported into. -->

<!-- Download URL is inserted from the normalization code -->
  <xsl:param name="downloadUrl"/>

<!-- 
Namespaces commonly used in RSS feeds 
-->

<xsl:variable name="_NSatom1" select="'http://www.w3.org/2005/Atom'"/>
<xsl:variable name="_NSatom03" select="'http://purl.org/atom/ns#'"/>
<xsl:variable name="_NSsy" select="'http://purl.org/rss/1.0/modules/syndication/'"/>
<xsl:variable name="_NScontent" select="'http://purl.org/rss/1.0/modules/content/'"/>
<xsl:variable name="_NSrdf" select="'http://www.w3.org/1999/02/22-rdf-syntax-ns#'"/>
<xsl:variable name="_NSrss" select="'http://purl.org/rss/1.0/'"/>
<xsl:variable name="_NSdc" select="'http://purl.org/dc/elements/1.1/'"/>
<xsl:variable name="_NSdcterms" select="'http://purl.org/dc/terms/'"/>
<xsl:variable name="_NSslash" select="'http://purl.org/rss/1.0/modules/slash/'"/>
<xsl:variable name="_NSwfw" select="'http://wellformedweb.org/CommentAPI/'"/>
<xsl:variable name="_NScf" select="'http://www.microsoft.com/schemas/rss/core/2005'"/>
<xsl:variable name="_NScfi" select="'http://www.microsoft.com/schemas/rss/core/2005/internal'"/>
<xsl:variable name="_NSxhtml" select="'http://www.w3.org/1999/xhtml'"/>
<xsl:variable name="_NSmon" select="'http://www.microsoft.com/schemas/rss/monitoring/2007'"/>


<!--
Conversion and utility/helper templates
-->

<!-- Find if current node is a first one of its kind; returns strings 'true' when first or 'false' when not -->
<xsl:template name="_IsFirstChildOfItsKind">
  <xsl:param name="value"/>
  <xsl:variable name="_nameSpace" select="namespace-uri($value)"/>
  <xsl:variable name="_localName" select="local-name($value)"/>
  <xsl:variable name="_currentId" select="generate-id($value)"/>
  <xsl:variable name="_firstId" select="generate-id($value/../*[namespace-uri(.) = $_nameSpace and local-name(.) = $_localName])"/>
  <xsl:choose>
    <xsl:when test="$_currentId = $_firstId">
      <xsl:value-of select="'true'"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="'false'"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<!-- Convert updateFrequency and updatePeriod to ttl -->
  <xsl:template name="_ConvertUpdatesToTtl">
    <xsl:param name="updateFrequency"/>
    <xsl:param name="updatePeriod"/>
    <xsl:variable name="_updateFrequencyNum" select="number($updateFrequency)"/>
    <xsl:variable name="_updatePeriodTmp">
      <xsl:choose>
        <xsl:when test="$updatePeriod = 'hourly'">60</xsl:when>
        <xsl:when test="$updatePeriod = 'daily'">1440</xsl:when>
        <xsl:when test="$updatePeriod = 'weekly'">10080</xsl:when>
        <xsl:when test="$updatePeriod = 'monthly'">40320</xsl:when>
        <xsl:when test="$updatePeriod = 'yearly'">483840</xsl:when>
        <xsl:otherwise>-1</xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:variable name="_updatePeriodNum" select="number($_updatePeriodTmp)"/>
    <xsl:if test="$_updateFrequencyNum &gt; 0 and $_updatePeriodNum &gt; 0">
      <ttl>
        <xsl:value-of select="$_updatePeriodNum div $_updateFrequencyNum"/>
      </ttl>
    </xsl:if>
  </xsl:template>

<!-- Convert author strings to Atom format (very simple implementation) -->
  <!-- NOTE: Assumes that value has been properly scrubbed and only needs to be parsed -->
  <xsl:template name="_ConvertAuthorToAtomAuthor">
    <xsl:param name="value"/>
    <xsl:if test="string($value)">
      <atom:author>
        <xsl:choose>
          <!-- No email -->
          <xsl:when test="contains($value, '@') = false">
            <atom:name><xsl:value-of select="$value"/></atom:name>
          </xsl:when>
          <!-- Name and email -->
          <xsl:when test="contains($value, '(') and contains($value, ')')">
            <xsl:variable name="_BeforeOpenParen" select="substring-before($value, '(')"/>
            <xsl:variable name="_AfterCloseParen" select="substring-after($value, ')')"/>
            <xsl:variable name="_WithinParens" select="substring-after(substring-before($value, ')'), '(')"/>
            <xsl:choose>
              <!-- Simple check for some possible weird cases -->
              <xsl:when test="contains($_BeforeOpenParen, ')') or contains($_AfterCloseParen, '(') or contains($_WithinParens, '(')">
                <atom:name><xsl:value-of select="$value"/></atom:name>
              </xsl:when>
              <!-- Email within parens -->
              <xsl:when test="contains($_WithinParens, '@')">
                <atom:name><xsl:value-of select="concat($_BeforeOpenParen, $_AfterCloseParen)"/></atom:name>
                <atom:email><xsl:value-of select="$_WithinParens"/></atom:email>
              </xsl:when>
              <!-- Name within parens -->
              <xsl:otherwise>
                <atom:name><xsl:value-of select="$_WithinParens"/></atom:name>
                <xsl:choose>
                  <!-- Email before parens -->
                  <xsl:when test="contains($_BeforeOpenParen, '@')">
                    <atom:email><xsl:value-of select="$_BeforeOpenParen"/></atom:email>
                  </xsl:when>
                  <!-- Email after parens -->
                  <xsl:otherwise>
                    <atom:email><xsl:value-of select="$_AfterCloseParen"/></atom:email>
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:when>
          <!-- Only email -->
          <xsl:otherwise>
            <atom:email><xsl:value-of select="$value"/></atom:email>
          </xsl:otherwise>
        </xsl:choose>
      </atom:author>
    </xsl:if>
  </xsl:template>

<!-- Convert Atom author strings to RSS 2.0 format with email and name -->
  <xsl:template name="_ConvertAtomAuthorToAuthor">
    <xsl:param name="name"/>
    <xsl:param name="email"/>
    <xsl:choose>
      <xsl:when test="string($name) and string($email)"><xsl:value-of select="concat($email, ' (', $name, ')')"/></xsl:when>
      <xsl:when test="string($email)"><xsl:value-of select="string($email)"/></xsl:when>
      <xsl:otherwise><xsl:value-of select="string($name)"/></xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  
<!-- Map type values to Atom 1.0 type -->
<!-- Note that our sanitization code can parse but cannot output XHTML, so xhtml gets converted to html -->
  <xsl:template name="_NormalizeAtomTextTypeAttr">
    <xsl:param name="value"/>
    <xsl:choose>
      <xsl:when test="not(string($value)) or normalize-space($value) = ''"><xsl:attribute name="type">text</xsl:attribute></xsl:when>
      <xsl:when test="$value = 'text/plain' or $value = 'text'"><xsl:attribute name="type">text</xsl:attribute></xsl:when>
      <xsl:when test="$value = 'text/html' or $value = 'html'"><xsl:attribute name="type">html</xsl:attribute></xsl:when>
      <xsl:when test="$value = 'application/xhtml+xml' or $value = 'xhtml'"><xsl:attribute name="type">html</xsl:attribute></xsl:when>
    </xsl:choose>
  </xsl:template>

<!-- Validate bool -->
  <xsl:template name="_ValidateBool">
    <xsl:param name="value"/>
    <xsl:choose>
      <xsl:when test="normalize-space($value) = 'true'">true</xsl:when>
      <xsl:when test="normalize-space($value) = 'false'">false</xsl:when>
    </xsl:choose>
  </xsl:template>

<!-- Build a list of nodes that are referenced from the cf:sort or cf:group -->
  <xsl:template name="_BuildCfReferenceList">
    <xsl:param name="value"/>
    <!-- We format the node references as "'namespace-uri':local-name;" -->
    <xsl:for-each select="$value/cf:listinfo/cf:sort">
      <xsl:choose>
        <xsl:when test="@element">'<xsl:value-of select="@ns"/>':<xsl:value-of select="@element"/>;</xsl:when>
        <xsl:otherwise>'<xsl:value-of select="@ns"/>':<xsl:value-of select="@label"/>;</xsl:otherwise>
      </xsl:choose>
    </xsl:for-each>
    <xsl:for-each select="$value/cf:listinfo/cf:group">
      <xsl:choose>
        <xsl:when test="@element">'<xsl:value-of select="@ns"/>':<xsl:value-of select="@element"/>;</xsl:when>
        <xsl:otherwise>'<xsl:value-of select="@ns"/>':<xsl:value-of select="@label"/>;</xsl:otherwise>
      </xsl:choose>
    </xsl:for-each>
  </xsl:template>

<!-- Ensure XHTML is the default namespace; needs to run prior to sanitization; exact preserving of namespace prefixes
is not important because sanitization will drop all the unknown elements anyway -->
  <xsl:template name="_NormalizeXhtmlNamespacePrefix">
    <xsl:param name="value"/>
    <xsl:for-each select="$value">
      <xsl:choose>
        <xsl:when test="self::text() or self::comment() or self::processing-instruction()">
          <xsl:copy/>
        </xsl:when>
        <!-- xhtml is default namespace: just copy and process children -->
        <xsl:when test="namespace-uri(.) = $_NSxhtml and not(contains(name(.), ':'))">
          <xsl:copy>
            <xsl:for-each select="@*"><xsl:copy/></xsl:for-each>
            <xsl:call-template name="_NormalizeXhtmlNamespacePrefix">
              <xsl:with-param name="value" select="*|text()"/>
            </xsl:call-template>
          </xsl:copy>
        </xsl:when>
        <xsl:otherwise>
          <xsl:choose>
            <!-- xhtml element in non-default namespace: fix namespace and process children -->
            <xsl:when test="namespace-uri(.) = $_NSxhtml">
              <xsl:element name="{local-name(.)}" namespace="{$_NSxhtml}">
                <xsl:for-each select="@*"><xsl:copy/></xsl:for-each>
                <xsl:call-template name="_NormalizeXhtmlNamespacePrefix">
                  <xsl:with-param name="value" select="*|text()"/>
                </xsl:call-template>
              </xsl:element>
            </xsl:when>
            <!-- non-xhtml element in default namespace: fix namespace and process children -->
            <xsl:otherwise>
              <xsl:element name="{concat('x:', local-name(.))}" namespace="{namespace-uri(.)}">
                <xsl:for-each select="@*"><xsl:copy/></xsl:for-each>
                <xsl:call-template name="_NormalizeXhtmlNamespacePrefix">
                  <xsl:with-param name="value" select="*|text()"/>
                </xsl:call-template>
              </xsl:element>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:for-each>
  </xsl:template>

<!-- Combine base and relative URLs -->
  <xsl:template name="_CombineUrls">
    <xsl:param name="baseUrl"/>
    <xsl:param name="relUrl"/>
    <xsl:choose>
      <xsl:when test="string($baseUrl)">
        <xsl:value-of select="msfeednorm:CombineUrls(string($baseUrl), string($relUrl))"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="string($relUrl)"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

<!-- Check for URL and combine it with base (complete the URL) -->
  <xsl:template name="_CompleteUrl">
    <xsl:param name="Url"/>
    <xsl:param name="baseUrl"/>
    <xsl:if test="string($Url)">
      <xsl:value-of select="msfeednorm:CombineUrls(string($baseUrl), string($Url))"/>
    </xsl:if>
  </xsl:template>

<!-- Complete URL in order: baseUrl1 + baseUrl2 + Url -->
  <xsl:template name="_CompleteUrlTwoBase">
    <xsl:param name="Url"/>
    <xsl:param name="baseUrl1"/>
    <xsl:param name="baseUrl2"/>
    <xsl:variable name="combinedBase">
      <xsl:call-template name="_CombineUrls">
        <xsl:with-param name="baseUrl" select="$baseUrl1"/>
        <xsl:with-param name="relUrl" select="$baseUrl2"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:call-template name="_CompleteUrl">
      <xsl:with-param name="Url" select="$Url"/>
      <xsl:with-param name="baseUrl" select="$combinedBase"/>
    </xsl:call-template>
  </xsl:template>

<!-- Figure out the base URL for the feed -->
  <xsl:template name="_GetFeedBaseUrl">
    <xsl:param name="downloadUrl"/>
    <xsl:param name="rootNode"/>
    <xsl:choose>
      <xsl:when test="string($rootNode/@xml:base)">
        <xsl:call-template name="_CombineUrls">
          <xsl:with-param name="baseUrl" select="$downloadUrl"/>
          <xsl:with-param name="relUrl" select="$rootNode/@xml:base"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="string($downloadUrl)"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>


<!--
Sanitization and validation templates
-->

<!-- Invoke sanitization and/or transformation based on the from and to types -->
  <xsl:template name="_CleanByType">
    <xsl:param name="value"/>
    <xsl:param name="fromType"/>
    <xsl:param name="toType"/>
    <xsl:param name="baseUrl"/>
    <xsl:variable name="fromTypeN" select="normalize-space($fromType)"/>
    <xsl:variable name="toTypeN" select="normalize-space($toType)"/>
    <xsl:choose>
      <xsl:when test="not(string($fromTypeN)) or $fromTypeN = 'text' or $fromTypeN = 'text/plain'">
        <xsl:choose>
          <!-- text->text: just copy -->
          <xsl:when test="not(string($toTypeN)) or $toTypeN = 'text' or $toTypeN = 'text/plain'">
            <xsl:value-of select="$value"/>
          </xsl:when>
          <!-- text->html: escape -->
          <xsl:when test="$toTypeN = 'html' or $toTypeN = 'text/html'">
            <xsl:value-of select="msfeednorm:HtmlEscape(string($value))"/>
          </xsl:when>
        </xsl:choose>
      </xsl:when>
      <xsl:when test="$fromTypeN = 'html' or $fromTypeN = 'text/html'">
        <xsl:choose>
          <!-- html->text: drop all html and unescape -->
          <xsl:when test="not(string($toTypeN)) or $toTypeN = 'text' or $toTypeN = 'text/plain'">
            <xsl:value-of select="msfeednorm:CleanHtmlToPlainText(string($value))"/>
          </xsl:when>
          <!-- html->html: drop unsafe html -->
          <xsl:when test="$toTypeN = 'html' or $toTypeN = 'text/html'">
            <xsl:value-of select="msfeednorm:CleanHtmlToSafeHtml(string($baseUrl), string($value))"/>
          </xsl:when>
        </xsl:choose>
      </xsl:when>
      <xsl:when test="$fromTypeN = 'xhtml' or $fromTypeN = 'application/xhtml+xml'">
        <xsl:variable name="normXhtml">
          <xsl:call-template name="_NormalizeXhtmlNamespacePrefix">
            <xsl:with-param name="value" select="$value/*"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:choose>
          <!-- xhtml->text: drop all html and unescape -->
          <xsl:when test="not(string($toTypeN)) or $toTypeN = 'text' or $toTypeN = 'text/plain'">
            <xsl:value-of select="msfeednorm:CleanXhtmlToPlainText($normXhtml)"/>
          </xsl:when>
          <!-- xhtml->html: drop unsafe html -->
          <xsl:when test="$toTypeN = 'html' or $toTypeN = 'text/html'">
            <xsl:value-of select="msfeednorm:CleanXhtmlToSafeXhtml(string($baseUrl), $normXhtml)"/>
          </xsl:when>
        </xsl:choose>
      </xsl:when>
      <!-- Note that any unknown type value will yield empty output -->
    </xsl:choose>
  </xsl:template>


<!--
Generic output templates
-->

<!-- Output attribute with plain text value -->
  <xsl:template name="_OutputTextAttribute">
    <xsl:param name="tagName"/>
    <xsl:param name="nameSpace" select="''"/>
    <xsl:param name="value"/>
    <xsl:variable name="_validatedValue">
      <xsl:call-template name="_CleanByType">
        <xsl:with-param name="value" select="$value"/>
        <xsl:with-param name="fromType" select="'text'"/>
        <xsl:with-param name="toType" select="'text'"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:if test="string($_validatedValue)">
      <xsl:attribute name="{$tagName}" namespace="{$nameSpace}"><xsl:value-of select="$_validatedValue"/></xsl:attribute>
    </xsl:if>
  </xsl:template>
  
<!-- Output attribute with bool value -->
  <xsl:template name="_OutputBoolAttribute">
    <xsl:param name="tagName"/>
    <xsl:param name="nameSpace" select="''"/>
    <xsl:param name="value"/>
    <xsl:variable name="_validatedValue">
      <xsl:call-template name="_ValidateBool"><xsl:with-param name="value" select="$value"/></xsl:call-template>
    </xsl:variable>
    <xsl:if test="string($_validatedValue)">
      <xsl:attribute name="{$tagName}" namespace="{$nameSpace}"><xsl:value-of select="$_validatedValue"/></xsl:attribute>
    </xsl:if>
  </xsl:template>

<!-- Output attribute with URL value -->
  <xsl:template name="_OutputUrlAttribute">
    <xsl:param name="tagName"/>
    <xsl:param name="nameSpace" select="''"/>
    <xsl:param name="value"/>
    <xsl:variable name="_validatedValue" select="msfeednorm:ValidateUrl(normalize-space($value))"/>
    <xsl:if test="string($_validatedValue)">
      <xsl:attribute name="{$tagName}" namespace="{$nameSpace}"><xsl:value-of select="$_validatedValue"/></xsl:attribute>
    </xsl:if>
  </xsl:template>
  
  <xsl:template name="_OutputUriAttribute">
    <xsl:param name="tagName"/>
    <xsl:param name="nameSpace" select="''"/>
    <xsl:param name="value"/>
    <xsl:variable name="_validatedValue" select="msfeednorm:NormalizeUri(normalize-space($value))"/>
    <xsl:if test="string($_validatedValue)">
      <xsl:attribute name="{$tagName}" namespace="{$nameSpace}"><xsl:value-of select="$_validatedValue"/></xsl:attribute>
    </xsl:if>
  </xsl:template>

<!-- Output attribute with mime-type value -->
  <xsl:template name="_OutputMimeTypeAttribute">
    <xsl:param name="tagName"/>
    <xsl:param name="nameSpace" select="''"/>
    <xsl:param name="value"/>
    <xsl:variable name="_validatedValue" select="normalize-space($value)"/>
    <xsl:if test="string($_validatedValue)">
      <xsl:attribute name="{$tagName}" namespace="{$nameSpace}"><xsl:value-of select="$_validatedValue"/></xsl:attribute>
    </xsl:if>
  </xsl:template>

<!-- Output attribute with non-negative number value -->
  <xsl:template name="_OutputPositiveNumberAttribute">
    <xsl:param name="tagName"/>
    <xsl:param name="nameSpace" select="''"/>
    <xsl:param name="value"/>
    <xsl:variable name="_validatedValue" select="number($value)"/>
    <xsl:if test="(string($_validatedValue) != 'NaN') and ($_validatedValue &gt;= 0)">
      <xsl:attribute name="{$tagName}" namespace="{$nameSpace}"><xsl:value-of select="$_validatedValue"/></xsl:attribute>
    </xsl:if>
  </xsl:template>

<!-- Output element with plain text value -->
  <xsl:template name="_OutputTextElement">
    <xsl:param name="tagName"/>
    <xsl:param name="nameSpace" select="''"/>
    <xsl:param name="value"/>
    <xsl:param name="type" select="'text'"/>
    <xsl:param name="outputTypeAttribute" select="'false'"/>
    <xsl:variable name="_validatedValue">
      <xsl:call-template name="_CleanByType">
        <xsl:with-param name="value" select="$value"/>
        <xsl:with-param name="fromType" select="$type"/>
        <xsl:with-param name="toType" select="'text'"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:if test="string($_validatedValue)">
      <xsl:element name="{$tagName}" namespace="{$nameSpace}">
        <xsl:if test="$outputTypeAttribute = 'true'">
          <xsl:attribute name="cf:type" namespace="{$_NScf}">text</xsl:attribute>
        </xsl:if>
        <xsl:value-of select="$_validatedValue"/>
      </xsl:element>
    </xsl:if>
  </xsl:template>

<!-- Output element with URL value -->
  <xsl:template name="_OutputUrlElement">
    <xsl:param name="tagName"/>
    <xsl:param name="nameSpace" select="''"/>
    <xsl:param name="value"/>
    <xsl:variable name="_validatedValue" select="msfeednorm:ValidateUrl(normalize-space($value))"/>
    <xsl:if test="string($_validatedValue)">
      <xsl:element name="{$tagName}" namespace="{$nameSpace}"><xsl:value-of select="$_validatedValue"/></xsl:element>
    </xsl:if>
  </xsl:template>

<!-- Output element with inet date value -->
  <xsl:template name="_OutputDateElement">
    <xsl:param name="tagName"/>
    <xsl:param name="nameSpace" select="''"/>
    <xsl:param name="value"/>
    <xsl:param name="outFormat" select="'inetDate'"/>
    <xsl:variable name="_validatedValue">
      <xsl:choose>
        <xsl:when test="$outFormat = 'inetDate'">
          <xsl:value-of select="msfeednorm:NormalizeDateToInetDate(normalize-space($value))"/>
        </xsl:when>
        <xsl:when test="$outFormat = 'iso8601'">
          <xsl:value-of select="msfeednorm:NormalizeDateToIso8601(normalize-space($value))"/>
        </xsl:when>
      </xsl:choose>
    </xsl:variable>
    <xsl:if test="string($_validatedValue)">
      <xsl:element name="{$tagName}" namespace="{$nameSpace}"><xsl:value-of select="$_validatedValue"/></xsl:element>
    </xsl:if>
  </xsl:template>

<!-- Output element with a non-negative number value -->
  <xsl:template name="_OutputPositiveNumberElement">
    <xsl:param name="tagName"/>
    <xsl:param name="nameSpace" select="''"/>
    <xsl:param name="value"/>
    <xsl:variable name="_validatedValue" select="number($value)"/>
    <xsl:if test="(string($_validatedValue) != 'NaN') and ($_validatedValue &gt;= 0)">
      <xsl:element name="{$tagName}" namespace="{$nameSpace}"><xsl:value-of select="$_validatedValue"/></xsl:element>
    </xsl:if>
  </xsl:template>
  
<!-- Output RSS 2.0 author or managingEditor element and convert into atom:author -->
  <xsl:template name="_OutputAuthorOrEditor">
    <xsl:param name="tagName"/>
    <xsl:param name="value"/>
    <xsl:param name="convertToAtom" select="'false'"/>
    <xsl:variable name="_validatedValue" select="normalize-space($value)"/>
    <xsl:if test="string($_validatedValue)">
      <xsl:element name="{$tagName}"><xsl:value-of select="$_validatedValue"/></xsl:element>
      <xsl:if test="$convertToAtom = 'true'">
        <xsl:call-template name="_ConvertAuthorToAtomAuthor"><xsl:with-param name="value" select="$_validatedValue"/></xsl:call-template>
      </xsl:if>
    </xsl:if>
  </xsl:template>
  
<!-- Output atom:author or atom:contributor (have identical handling) -->
  <xsl:template name="_OutputAtomAuthorOrContributor">
    <xsl:param name="tagName"/>
    <xsl:param name="name"/>
    <xsl:param name="email"/>
    <xsl:param name="uri"/>
    <xsl:variable name="_validatedName" select="normalize-space($name)"/>
    <xsl:variable name="_validatedEmail" select="normalize-space($email)"/>
    <xsl:if test="string($_validatedName) or string($_validatedEmail)">
      <xsl:element name="{$tagName}" namespace="{$_NSatom1}">
        <xsl:if test="string($_validatedName)">
          <atom:name><xsl:value-of select="$_validatedName"/></atom:name>
        </xsl:if>
        <xsl:if test="string($_validatedEmail)">
          <atom:email><xsl:value-of select="$_validatedEmail"/></atom:email>
        </xsl:if>
        <xsl:variable name="_validatedUri" select="msfeednorm:NormalizeUri(normalize-space($uri))"/>
        <xsl:if test="string($_validatedUri)">
          <atom:uri><xsl:value-of select="$_validatedUri"/></atom:uri>
        </xsl:if>
      </xsl:element>
    </xsl:if>
  </xsl:template>



<!--
Common feed format output templates
-->

<!-- xml:lang -->
  <xsl:template name="_OutputXmlLang">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputTextAttribute">
      <xsl:with-param name="tagName" select="'xml:lang'"/>
      <xsl:with-param name="value" select="$value"/>
    </xsl:call-template>
  </xsl:template>
  
<!-- xml:base -->
  <xsl:template name="_OutputXmlBase">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputUrlAttribute">
      <xsl:with-param name="tagName" select="'xml:base'"/>
      <xsl:with-param name="value" select="$value"/>
    </xsl:call-template>
  </xsl:template>

<!-- title -->
  <xsl:template name="_OutputTitle">
    <xsl:param name="value"/>
    <xsl:param name="type"/>
    <xsl:call-template name="_OutputTextElement">
      <xsl:with-param name="tagName" select="'title'"/>
      <xsl:with-param name="value" select="$value"/>
      <xsl:with-param name="type" select="$type"/>
      <xsl:with-param name="outputTypeAttribute" select="'true'"/>
    </xsl:call-template>
  </xsl:template>

<!-- link -->
  <xsl:template name="_OutputLink">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputUrlElement">
      <xsl:with-param name="tagName" select="'link'"/>
      <xsl:with-param name="value" select="$value"/>
    </xsl:call-template>
  </xsl:template>

<!-- plain-text description -->
  <xsl:template name="_OutputTextDescription">
    <xsl:param name="value"/>
    <xsl:param name="type"/>
    <xsl:call-template name="_OutputTextElement">
      <xsl:with-param name="tagName" select="'description'"/>
      <xsl:with-param name="value" select="$value"/>
      <xsl:with-param name="type" select="$type"/>
      <xsl:with-param name="outputTypeAttribute" select="'true'"/>
    </xsl:call-template>
  </xsl:template>

<!-- pubDate -->
  <xsl:template name="_OutputPubDate">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputDateElement">
      <xsl:with-param name="tagName" select="'pubDate'"/>
      <xsl:with-param name="value" select="$value"/>
    </xsl:call-template>
  </xsl:template>

<!-- language -->
  <xsl:template name="_OutputLanguage">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputTextElement">
      <xsl:with-param name="tagName" select="'language'"/>
      <xsl:with-param name="value" select="$value"/>
    </xsl:call-template>
  </xsl:template>

<!-- copyright -->
  <xsl:template name="_OutputCopyright">
    <xsl:param name="value"/>
    <xsl:param name="type"/>
    <xsl:call-template name="_OutputTextElement">
      <xsl:with-param name="tagName" select="'copyright'"/>
      <xsl:with-param name="value" select="$value"/>
      <xsl:with-param name="type" select="$type"/>
      <xsl:with-param name="outputTypeAttribute" select="'true'"/>
    </xsl:call-template>
  </xsl:template>

<!-- lastBuildDate -->
  <xsl:template name="_OutputLastBuildDate">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputDateElement">
      <xsl:with-param name="tagName" select="'lastBuildDate'"/>
      <xsl:with-param name="value" select="$value"/>
    </xsl:call-template>
  </xsl:template>

<!-- managingEditor -->
  <xsl:template name="_OutputManagingEditor">
    <xsl:param name="value"/>
    <xsl:param name="convertToAtom" select="'false'"/>
    <xsl:call-template name="_OutputAuthorOrEditor">
      <xsl:with-param name="tagName" select="'managingEditor'"/>
      <xsl:with-param name="value" select="$value"/>
      <xsl:with-param name="convertToAtom" select="$convertToAtom"/>
    </xsl:call-template>
  </xsl:template>

<!-- webMaster -->
  <xsl:template name="_OutputWebMaster">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputTextElement">
      <xsl:with-param name="tagName" select="'webMaster'"/>
      <xsl:with-param name="value" select="$value"/>
    </xsl:call-template>
  </xsl:template>

<!-- category -->
  <xsl:template name="_OutputCategory">
    <xsl:param name="value"/>
    <xsl:param name="domain"/>
    <xsl:variable name="_validatedValue" select="normalize-space($value)"/>
    <xsl:if test="string($_validatedValue)">
      <xsl:element name="category">
        <xsl:call-template name="_OutputTextAttribute">
          <xsl:with-param name="tagName" select="'domain'"/>
          <xsl:with-param name="value" select="$domain"/>
        </xsl:call-template>
        <xsl:value-of select="$_validatedValue"/>
      </xsl:element>
    </xsl:if>
  </xsl:template>

<!-- generator -->
  <xsl:template name="_OutputGenerator">
    <xsl:param name="value"/>
    <xsl:param name="uri"/>
    <xsl:param name="version"/>
    <xsl:variable name="_validatedValue" select="normalize-space($value)"/>
    <xsl:if test="string($_validatedValue)">
      <xsl:element name="generator">
        <xsl:call-template name="_OutputUriAttribute">
          <xsl:with-param name="tagName" select="'cf:uri'"/>
          <xsl:with-param name="nameSpace" select="$_NScf"/>
          <xsl:with-param name="value" select="$uri"/>
        </xsl:call-template>
        <xsl:call-template name="_OutputTextAttribute">
          <xsl:with-param name="tagName" select="'cf:version'"/>
          <xsl:with-param name="nameSpace" select="$_NScf"/>
          <xsl:with-param name="value" select="$version"/>
        </xsl:call-template>
        <xsl:value-of select="$_validatedValue"/>
      </xsl:element>
    </xsl:if>
  </xsl:template>

<!-- docs -->
  <xsl:template name="_OutputDocs">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputUrlElement">
      <xsl:with-param name="tagName" select="'docs'"/>
      <xsl:with-param name="value" select="$value"/>
    </xsl:call-template>
  </xsl:template>

<!-- cloud -->
  <xsl:template name="_OutputCloud">
    <xsl:param name="value"/>
    <!-- We always output this element and clean any attribute it has into text -->
    <cloud>
      <xsl:for-each select="$value/@*">
        <xsl:attribute name="{name(.)}"><xsl:value-of select="normalize-space(.)"/></xsl:attribute>
      </xsl:for-each>
    </cloud>
  </xsl:template>

<!-- ttl -->
  <xsl:template name="_OutputTtl">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputPositiveNumberElement">
      <xsl:with-param name="tagName" select="'ttl'"/>
      <xsl:with-param name="value" select="$value"/>
    </xsl:call-template>
  </xsl:template>

<!-- image -->
  <xsl:template name="_OutputImage">
    <xsl:param name="url"/>
    <xsl:param name="title"/>
    <xsl:param name="titleType" select="'text'"/>
    <xsl:param name="link"/>
    <xsl:param name="width"/>
    <xsl:param name="height"/>
    <xsl:param name="description"/>
    <xsl:param name="subnodesToCopy"/>
    <xsl:variable name="_validatedUrl" select="msfeednorm:ValidateUrl(normalize-space($url))"/>
    <xsl:if test="string($_validatedUrl)">
      <image>
        <url><xsl:value-of select="$_validatedUrl"/></url>
        <xsl:call-template name="_OutputTextElement">
          <xsl:with-param name="tagName" select="'title'"/>
          <xsl:with-param name="value" select="$title"/>
          <xsl:with-param name="type" select="$titleType"/>
        </xsl:call-template>
        <xsl:call-template name="_OutputUrlElement">
          <xsl:with-param name="tagName" select="'link'"/>
          <xsl:with-param name="value" select="$link"/>
        </xsl:call-template>
        <xsl:call-template name="_OutputPositiveNumberElement">
          <xsl:with-param name="tagName" select="'width'"/>
          <xsl:with-param name="value" select="$width"/>
        </xsl:call-template>
        <xsl:call-template name="_OutputPositiveNumberElement">
          <xsl:with-param name="tagName" select="'height'"/>
          <xsl:with-param name="value" select="$height"/>
        </xsl:call-template>
        <xsl:call-template name="_OutputTextElement">
          <xsl:with-param name="tagName" select="'description'"/>
          <xsl:with-param name="value" select="$description"/>
        </xsl:call-template>
        <xsl:if test="boolean($subnodesToCopy)">
          <xsl:for-each select="$subnodesToCopy">
            <xsl:copy-of select="."/>
          </xsl:for-each>
        </xsl:if>
      </image>
    </xsl:if>
  </xsl:template>

<!-- rating -->
  <xsl:template name="_OutputRating">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputTextElement">
      <xsl:with-param name="tagName" select="'rating'"/>
      <xsl:with-param name="value" select="$value"/>
    </xsl:call-template>
  </xsl:template>

<!-- textInput -->
  <xsl:template name="_OutputTextInput">
    <xsl:param name="title"/>
    <xsl:param name="name"/>
    <xsl:param name="link"/>
    <xsl:param name="description"/>
    <xsl:param name="subnodesToCopy"/>
    <xsl:variable name="_validatedName" select="normalize-space($name)"/>
    <xsl:variable name="_validatedLink" select="msfeednorm:ValidateUrl(normalize-space($link))"/>
    <xsl:if test="string($_validatedName) and string($_validatedLink)">
      <textInput>
        <name><xsl:value-of select="$_validatedName"/></name>
        <link><xsl:value-of select="$_validatedLink"/></link>
        <xsl:call-template name="_OutputTextElement">
          <xsl:with-param name="tagName" select="'title'"/>
          <xsl:with-param name="value" select="$title"/>
        </xsl:call-template>
        <xsl:call-template name="_OutputTextElement">
          <xsl:with-param name="tagName" select="'description'"/>
          <xsl:with-param name="value" select="$description"/>
        </xsl:call-template>
        <xsl:if test="boolean($subnodesToCopy)">
          <xsl:for-each select="$subnodesToCopy">
            <xsl:copy-of select="."/>
          </xsl:for-each>
        </xsl:if>
      </textInput>
    </xsl:if>
  </xsl:template>

<!-- skipHours -->
  <xsl:template name="_OutputSkipHours">
    <xsl:param name="value"/>
    <xsl:if test="$value/hour[number(.)&gt;=0 and number(.)&lt;=23]">
      <skipHours>
        <xsl:for-each select="$value/hour">
          <xsl:variable name="_numberHour" select="number(.)"/>
          <xsl:if test="$_numberHour &gt;= 0 and $_numberHour &lt;= 23">
            <hour><xsl:value-of select="$_numberHour"/></hour>
          </xsl:if>
        </xsl:for-each>
      </skipHours>
    </xsl:if>
  </xsl:template>

<!-- skipDays -->
  <xsl:template name="_OutputSkipDays">
    <xsl:param name="value"/>
    <xsl:if test="$value/day[string(.) = 'Monday' or string(.) = 'Tuesday' or string(.) = 'Wednesday' or string(.) = 'Thursday' or string(.) = 'Friday' or string(.) = 'Saturday' or string(.) = 'Sunday']">
      <skipDays>
        <xsl:for-each select="$value/day">
          <xsl:variable name="_stringDay" select="string(.)"/>
          <xsl:if test="$_stringDay = 'Monday' or $_stringDay = 'Tuesday' or $_stringDay = 'Wednesday' or $_stringDay = 'Thursday' or $_stringDay = 'Friday' or $_stringDay = 'Saturday' or $_stringDay = 'Sunday'">
            <day><xsl:value-of select="$_stringDay"/></day>
          </xsl:if>
        </xsl:for-each>
      </skipDays>
    </xsl:if>
  </xsl:template>

<!-- author -->
  <xsl:template name="_OutputAuthor">
    <xsl:param name="value"/>
    <xsl:param name="convertToAtom" select="'false'"/>
    <xsl:call-template name="_OutputAuthorOrEditor">
      <xsl:with-param name="tagName" select="'author'"/>
      <xsl:with-param name="value" select="$value"/>
      <xsl:with-param name="convertToAtom" select="$convertToAtom"/>
    </xsl:call-template>
  </xsl:template>

<!-- comments -->
  <xsl:template name="_OutputComments">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputUrlElement">
      <xsl:with-param name="tagName" select="'comments'"/>
      <xsl:with-param name="value" select="$value"/>
    </xsl:call-template>
  </xsl:template>

<!-- enclosure -->
  <xsl:template name="_OutputEnclosure">
    <xsl:param name="url"/>
    <xsl:param name="length"/>
    <xsl:param name="type"/>
    <xsl:variable name="_validatedUrl" select="msfeednorm:ValidateUrl(normalize-space($url))"/>
    <xsl:if test="string($_validatedUrl)">
      <enclosure>
        <xsl:attribute name="url"><xsl:value-of select="$_validatedUrl"/></xsl:attribute>
        <xsl:call-template name="_OutputPositiveNumberAttribute">
          <xsl:with-param name="tagName" select="'length'"/>
          <xsl:with-param name="value" select="$length"/>
        </xsl:call-template>
        <xsl:call-template name="_OutputMimeTypeAttribute">
          <xsl:with-param name="tagName" select="'type'"/>
          <xsl:with-param name="value" select="$type"/>
        </xsl:call-template>
      </enclosure>
    </xsl:if>
  </xsl:template>

<!-- guid -->
  <xsl:template name="_OutputGuid">
    <xsl:param name="value"/>
    <xsl:param name="isPermaLink"/>
    <xsl:param name="channelGuid" select="'false'"/>
    <xsl:variable name="_validatedValue">
      <xsl:choose>
        <xsl:when test="normalize-space($isPermaLink) = 'true' or not(string($isPermaLink))">
          <xsl:value-of select="msfeednorm:ValidateUrl(normalize-space($value))"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="string($value)"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:if test="string($_validatedValue)">
      <xsl:choose>
        <xsl:when test="$channelGuid = 'false'">
          <xsl:element name="guid">
            <xsl:call-template name="_OutputBoolAttribute">
              <xsl:with-param name="tagName" select="'isPermaLink'"/>
              <xsl:with-param name="value" select="$isPermaLink"/>
            </xsl:call-template>
            <xsl:value-of select="$_validatedValue"/>
          </xsl:element>
        </xsl:when>
        <xsl:otherwise>
          <xsl:element name="cf:guid" namespace="{$_NScf}">
            <xsl:call-template name="_OutputBoolAttribute">
              <xsl:with-param name="tagName" select="'isPermaLink'"/>
              <xsl:with-param name="value" select="$isPermaLink"/>
            </xsl:call-template>
            <xsl:value-of select="$_validatedValue"/>
          </xsl:element>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:if>
  </xsl:template>
  
<!-- source -->
  <xsl:template name="_OutputSource">
    <xsl:param name="value"/>
    <xsl:param name="url"/>
    <xsl:variable name="_validatedValue" select="normalize-space($value)"/>
    <xsl:if test="string($_validatedValue)">
      <xsl:element name="source">
        <xsl:call-template name="_OutputUrlAttribute">
          <xsl:with-param name="tagName" select="'url'"/>
          <xsl:with-param name="value" select="$url"/>
        </xsl:call-template>
        <xsl:value-of select="$_validatedValue"/>
      </xsl:element>
    </xsl:if>
  </xsl:template>

<!-- rich-text description -->
  <xsl:template name="_OutputDescription">
    <xsl:param name="value"/>
    <xsl:param name="type"/>
    <xsl:param name="baseUrl"/>
    <!-- Description is always html -->
    <description cf:type="html">
      <xsl:call-template name="_CleanByType">
        <xsl:with-param name="value" select="$value"/>
        <xsl:with-param name="fromType" select="$type"/>
        <xsl:with-param name="toType" select="'html'"/>
        <xsl:with-param name="baseUrl" select="$baseUrl"/>
      </xsl:call-template>
    </description>
  </xsl:template>

<!-- atom:summary -->
  <xsl:template name="_OutputAtomSummary">
    <xsl:param name="value"/>
    <xsl:param name="type"/>
    <xsl:param name="xmlBase"/>
    <xsl:param name="baseUrl"/>
    <atom:summary>
      <xsl:call-template name="_OutputXmlBase"><xsl:with-param name="value" select="$xmlBase"/></xsl:call-template>
      <xsl:call-template name="_NormalizeAtomTextTypeAttr"><xsl:with-param name="value" select="$type"/></xsl:call-template>
      <xsl:call-template name="_CleanByType">
        <xsl:with-param name="value" select="$value"/>
        <xsl:with-param name="fromType" select="$type"/>
        <xsl:with-param name="toType" select="$type"/>
        <xsl:with-param name="baseUrl" select="$baseUrl"/>
      </xsl:call-template>
    </atom:summary>
  </xsl:template>

<!-- description and summary (if it exists) -->
  <xsl:template name="_OutputDescriptionAndSummary">
    <xsl:param name="description"/>
    <xsl:param name="descriptionType"/>
    <xsl:param name="descriptionBaseUrl"/>
    <xsl:param name="summary"/>
    <xsl:param name="summaryType"/>
    <xsl:param name="summaryXmlBase"/>
    <xsl:param name="summaryBaseUrl"/>
    <xsl:call-template name="_OutputDescription">
      <xsl:with-param name="value" select="$description"/>
      <xsl:with-param name="type" select="$descriptionType"/>
      <xsl:with-param name="baseUrl" select="$descriptionBaseUrl"/>
    </xsl:call-template>
    <xsl:if test="string($summary)">
      <xsl:call-template name="_OutputAtomSummary">
        <xsl:with-param name="value" select="$summary"/>
        <xsl:with-param name="type" select="$summaryType"/>
        <xsl:with-param name="xmlBase" select="$summaryXmlBase"/>
        <xsl:with-param name="baseUrl" select="$summaryBaseUrl"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>

<!-- atom:link -->
  <xsl:template name="_OutputAtomLink">
    <xsl:param name="href"/>
    <xsl:param name="rel"/>
    <xsl:param name="type"/>
    <xsl:param name="title"/>
    <xsl:param name="hreflang"/>
    <xsl:param name="length"/>
    <xsl:param name="xmlBase"/>
    <xsl:variable name="_validatedHref" select="msfeednorm:ValidateUrl(normalize-space($href))"/>
    <xsl:if test="string($_validatedHref)">
      <atom:link>
        <xsl:attribute name="href"><xsl:value-of select="$_validatedHref"/></xsl:attribute>
        <xsl:call-template name="_OutputTextAttribute">
          <xsl:with-param name="tagName" select="'rel'"/>
          <xsl:with-param name="value" select="$rel"/>
        </xsl:call-template>
        <xsl:call-template name="_OutputMimeTypeAttribute">
          <xsl:with-param name="tagName" select="'type'"/>
          <xsl:with-param name="value" select="$type"/>
        </xsl:call-template>
        <xsl:call-template name="_OutputTextAttribute">
          <xsl:with-param name="tagName" select="'title'"/>
          <xsl:with-param name="value" select="$title"/>
        </xsl:call-template>
        <xsl:call-template name="_OutputTextAttribute">
          <xsl:with-param name="tagName" select="'hreflang'"/>
          <xsl:with-param name="value" select="$hreflang"/>
        </xsl:call-template>
        <xsl:call-template name="_OutputPositiveNumberAttribute">
          <xsl:with-param name="tagName" select="'length'"/>
          <xsl:with-param name="value" select="$length"/>
        </xsl:call-template>
        <xsl:call-template name="_OutputXmlBase">
          <xsl:with-param name="value" select="$xmlBase"/>
        </xsl:call-template>
      </atom:link>
    </xsl:if>
  </xsl:template>

<!-- atom:author -->
  <xsl:template name="_OutputAtomAuthor">
    <xsl:param name="name"/>
    <xsl:param name="email"/>
    <xsl:param name="uri"/>
    <xsl:call-template name="_OutputAtomAuthorOrContributor">
      <xsl:with-param name="tagName" select="'atom:author'"/>
      <xsl:with-param name="name" select="$name"/>
      <xsl:with-param name="email" select="$email"/>
      <xsl:with-param name="uri" select="$uri"/>
    </xsl:call-template>
  </xsl:template>

<!-- atom:contributor -->
  <xsl:template name="_OutputAtomContributor">
    <xsl:param name="name"/>
    <xsl:param name="email"/>
    <xsl:param name="uri"/>
    <xsl:call-template name="_OutputAtomAuthorOrContributor">
      <xsl:with-param name="tagName" select="'atom:contributor'"/>
      <xsl:with-param name="name" select="$name"/>
      <xsl:with-param name="email" select="$email"/>
      <xsl:with-param name="uri" select="$uri"/>
    </xsl:call-template>
  </xsl:template>
  
<!-- atom:published -->
  <xsl:template name="_OutputAtomPublished">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputDateElement">
      <xsl:with-param name="tagName" select="'atom:published'"/>
      <xsl:with-param name="nameSpace" select="$_NSatom1"/>
      <xsl:with-param name="value" select="$value"/>
      <xsl:with-param name="outFormat" select="'iso8601'"/>
    </xsl:call-template>
  </xsl:template>
  
<!-- atom:updated -->
  <xsl:template name="_OutputAtomUpdated">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputDateElement">
      <xsl:with-param name="tagName" select="'atom:updated'"/>
      <xsl:with-param name="nameSpace" select="$_NSatom1"/>
      <xsl:with-param name="value" select="$value"/>
      <xsl:with-param name="outFormat" select="'iso8601'"/>
    </xsl:call-template>
  </xsl:template>

<!-- slash:comments -->
  <xsl:template name="_OutputSlashComments">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputPositiveNumberElement">
      <xsl:with-param name="tagName" select="'slash:comments'"/>
      <xsl:with-param name="nameSpace" select="$_NSslash"/>
      <xsl:with-param name="value" select="$value"/>
    </xsl:call-template>
  </xsl:template>
  
<!-- wfw:commentRss -->
  <xsl:template name="_OutputWfwCommentRSS">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputUrlElement">
      <xsl:with-param name="tagName" select="'wfw:commentRss'"/>
      <xsl:with-param name="nameSpace" select="$_NSwfw"/>
      <xsl:with-param name="value" select="$value"/>
    </xsl:call-template>
  </xsl:template>
  
<!-- cf:treatAs -->
  <xsl:template name="_OutputCfTreatAs">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputTextElement">
      <xsl:with-param name="tagName" select="'cf:treatAs'"/>
      <xsl:with-param name="nameSpace" select="$_NScf"/>
      <xsl:with-param name="value" select="$value"/>
    </xsl:call-template>
  </xsl:template>

<!-- cf:listinfo -->
  <xsl:template name="_OutputCfListinfo">
    <xsl:param name="value"/>
    <cf:listinfo>
      <xsl:for-each select="$value/cf:sort">
        <xsl:variable name="_ValidatedSortElem" select="normalize-space(@element)"/>
        <xsl:variable name="_ValidatedSortLabel" select="normalize-space(@label)"/>
        <xsl:if test="string($_ValidatedSortElem) or string($_ValidatedSortLabel)">
          <cf:sort>
            <xsl:if test="string($_ValidatedSortElem)">
              <xsl:attribute name="element"><xsl:value-of select="$_ValidatedSortElem"/></xsl:attribute>
            </xsl:if>
            <xsl:if test="string($_ValidatedSortLabel)">
              <xsl:attribute name="label"><xsl:value-of select="$_ValidatedSortLabel"/></xsl:attribute>
            </xsl:if>
            <xsl:call-template name="_OutputTextAttribute">
              <xsl:with-param name="tagName" select="'ns'"/>
              <xsl:with-param name="value" select="@ns"/>
            </xsl:call-template>
            <xsl:call-template name="_OutputTextAttribute">
              <xsl:with-param name="tagName" select="'data-type'"/>
              <xsl:with-param name="value" select="@data-type"/>
            </xsl:call-template>
            <xsl:call-template name="_OutputBoolAttribute">
              <xsl:with-param name="tagName" select="'default'"/>
              <xsl:with-param name="value" select="@default"/>
            </xsl:call-template>
          </cf:sort>
        </xsl:if>
      </xsl:for-each>
      <xsl:for-each select="$value/cf:group">
        <xsl:variable name="_ValidatedGroupElem" select="normalize-space(@element)"/>
        <xsl:variable name="_ValidatedGroupLabel" select="normalize-space(@label)"/>
        <xsl:if test="string($_ValidatedGroupElem) or string($_ValidatedGroupLabel)">
          <cf:group>
            <xsl:if test="string($_ValidatedGroupElem)">
              <xsl:attribute name="element"><xsl:value-of select="$_ValidatedGroupElem"/></xsl:attribute>
            </xsl:if>
            <xsl:if test="string($_ValidatedGroupLabel)">
              <xsl:attribute name="label"><xsl:value-of select="$_ValidatedGroupLabel"/></xsl:attribute>
            </xsl:if>
            <xsl:call-template name="_OutputTextAttribute">
              <xsl:with-param name="tagName" select="'ns'"/>
              <xsl:with-param name="value" select="@ns"/>
            </xsl:call-template>
          </cf:group>
        </xsl:if>
      </xsl:for-each>
    </cf:listinfo>
  </xsl:template>

<!-- mon:expiration -->
  <xsl:template name="_OutputMonExpiration">
    <xsl:param name="value"/>
    <xsl:call-template name="_OutputDateElement">
      <xsl:with-param name="tagName" select="'mon:expiration'"/>
      <xsl:with-param name="nameSpace" select="$_NSmon"/>
      <xsl:with-param name="value" select="$value"/>
      <xsl:with-param name="outFormat" select="'iso8601'"/>
    </xsl:call-template>
  </xsl:template>
  
<!-- output the extension nodes -->
  <xsl:template name="_OutputExtension">
    <xsl:param name="value"/>
    <xsl:param name="references"/>
    <xsl:if test="namespace-uri($value) != $_NScfi">
      <xsl:variable name="nodeRefName">'<xsl:value-of select="namespace-uri($value)"/>':<xsl:value-of select="local-name($value)"/>;</xsl:variable>
      <xsl:choose>
        <xsl:when test="string($references) and contains($references, $nodeRefName)">
          <xsl:call-template name="_OutputTextElement">
            <xsl:with-param name="value" select="$value"/>
            <xsl:with-param name="tagName" select="name($value)"/>
            <xsl:with-param name="nameSpace" select="namespace-uri($value)"/>
          </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
          <xsl:copy-of select="$value"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:if>
  </xsl:template>

</xsl:stylesheet>
PAPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPAD

Youez - 2016 - github.com/yon3zu
LinuXploit