﻿<?xml version="1.0" encoding="utf-8" ?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rs='urn:schemas-microsoft-com:rowset' 
xmlns:z='#RowsetSchema'
version="1.0">
	
	<xsl:output method="html" indent="yes" omit-xml-declaration="yes"/>
	<xsl:variable name="cultura" select="substring(//culture/ui/@name,1,2)"></xsl:variable>
	<xsl:variable name="url" select="substring-before(substring-after(//querystring/field[@name='Source'],'?'),'-')"></xsl:variable>
	<xsl:variable name="url2" select="substring-before(//querystring/field[@name=''],'-')"></xsl:variable>
	<xsl:variable name="Idioma">
		<xsl:choose>
			<xsl:when test="$url!=$url2 and $url=''">
				<xsl:value-of select="$url2" />
			</xsl:when>
			<xsl:when test="$cultura!=$url and $url!=$url2 and $url!=''">
				<xsl:value-of select="$url" />
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$cultura" />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:variable>
	<xsl:template match="/">
		<table>
				<xsl:choose>
					<xsl:when test="./data/row[Idioma=$Idioma]">
						<xsl:for-each select="./data/row[Idioma=$Idioma]">
							<xsl:sort select="./position"></xsl:sort>
							<tr>
								<td style="font-family:Verdana;font-size:18px;color:#fff;">
									<br></br>
									<xsl:value-of select="Title" />
								</td>
							</tr>
							<tr>
								<td style="font-family:Verdana;font-size:11px;color:#fff;">
									<xsl:value-of select="Descripcion" disable-output-escaping="yes"/>
								</td>
							</tr>
						</xsl:for-each>
					</xsl:when>
				</xsl:choose>
		</table>
	</xsl:template>
</xsl:stylesheet>

