Tempore 16:50:45, die 01/09/2005 AD, hinc in
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com scripsit Dionisio Ruiz de Zárate
<dionisio(_at_)tinieblas(_dot_)com>:
the question is that if i find one <actual> node with the t value (true)
i try to show its information into one table, i put, i want to put ,
into one col the information if the <ttipo_noticia> node = noticia and
into other col if the <tipo_noticia> is = truco but only i can put into
the sama col.
Hi,
There are probably better solutions to solve this problem, but the
following stylesheet should work - It does the task that I understood from
your question.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:template match="registro">
<xsl:if test="actual='t'">
<table width="100%" border="0" cellpadding="0" cellspacing="1"
bgcolor="#FFFFFF">
<tr class="menuItem">
<td width="45%">Noticias</td>
<td width="55%">Trucos</td>
</tr>
<xsl:variable name="count1"
select="count(noticias/noticia[tipo_noticia='noticia'])"/>
<xsl:variable name="count2"
select="count(noticias/noticia[tipo_noticia='truco'])"/>
<xsl:variable name="maximum">
<xsl:if test="$count1 >= $count2"><xsl:value-of
select="$count1"/></xsl:if>
<xsl:if test="$count1 < $count2"><xsl:value-of
select="$count2"/></xsl:if>
</xsl:variable>
<xsl:for-each select="noticias/noticia[position() <=
$maximum]">
<xsl:variable name="count" select="position()"/>
<tr class="links">
<td><xsl:apply-templates
select="../noticia[tipo_noticia='noticia'][position()=$count]"/></td>
<td><xsl:apply-templates
select="../noticia[tipo_noticia='truco'][position()=$count]"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:if>
</xsl:template>
<xsl:template match="noticia">
<xsl:value-of select="titulo_noticiacastellano"
disable-output-escaping="yes"/>
</xsl:template>
</xsl:stylesheet>
regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
"Et ipsa scientia potestas est" - Francis Bacon , Meditationes sacrae
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--