<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:template match="/data">
	
	<table border="0" width="95%" id="table73" >
		<xsl:apply-templates select="row[position()=1]"/>
	</table>	
</xsl:template>

<xsl:template match="row">
	<tr><td colspan="2"><table><tr><td align="center"><span style="color: black;font-size:16px;"><xsl:value-of select="Title" /></span></td></tr></table></td></tr>
	<xsl:variable name="ImageUrl" select="substring-before(substring-after(PublishingPageImage,'src=&quot;'),'&quot;')"/>
		<xsl:choose>
			<xsl:when test="$ImageUrl!=''">
				<tr>
					<td colspan="2">
					<span style="color:#a60000; font-size:11px;font-weight:bold; font-style:italic;">
						"<xsl:value-of select="Comments"></xsl:value-of>"
						</span><br></br><br></br>
						Consulta planteada por <span style="color: #990000;font-weight:bold;"><xsl:value-of select="Solicitante" /></span> el <span style="color: #990000;font-weight:bold;"><xsl:value-of select="substring-before(FechaConsulta,' ')"/></span>
						Categoría: <span style="color: #990000;font-weight:bold;"><xsl:value-of select="substring-after(Categoria,'#')"/></span>
					</td>
				</tr>
				<tr><td colspan="2"> <hr style="height:1px; color: grey;"/></td></tr>
				<tr>
					<td valign="top"  style=" text-align:center;">
						<img style="  ">
							<xsl:attribute name="src"><xsl:value-of select="$ImageUrl"/></xsl:attribute>
						</img>
					</td>
				
				<td>
						
						<span>
							<xsl:value-of select="PublishingPageContent" disable-output-escaping="yes"/>
						</span>
						
					</td>
				</tr>
        <tr>
        	<TD></TD>
          <td>
            <a style="float:right;">
              <xsl:attribute name="href">
              	<xsl:value-of select="FileRef"/>
              </xsl:attribute>
              Leer más...
            </a>
          </td>
        </tr>
			</xsl:when>
			<xsl:otherwise>
				
				<tr>
					<td colspan="2">
					<span style="color:#000;">
						<xsl:value-of select="Comments"></xsl:value-of>
						</span><br></br><br></br>
						Consulta planteada por <span style="color: #990000;font-weight:bold;"><xsl:value-of select="Solicitante" /></span> el <span style="color: #990000;font-weight:bold;"><xsl:value-of select="substring-before(FechaConsulta,' ')"/></span>
						Categoría: <span style="color: #990000;font-weight:bold;"><xsl:value-of select="substring-after(Categoria,'#')"/></span>
					</td>
				</tr>
				<tr><td colspan="2"> <hr style="height:1px; color: grey;"/></td></tr>
				<tr>
					<td valign="top"  style=" text-align:center;">
					</td>
				
				<td>
						
						<span>
							<xsl:value-of select="PublishingPageContent" disable-output-escaping="yes"/>
						</span>
						
					</td>
				</tr>
        <tr>
        	<TD></TD>
          <td>
            <a style="float:right;">
              <xsl:attribute name="href">
              	<xsl:value-of select="FileRef"/>
              </xsl:attribute>
              Leer más...
            </a>
          </td>
        </tr>
			</xsl:otherwise>
		</xsl:choose>
</xsl:template>
</xsl:stylesheet>

