[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: one great problem for showing the info into one ta
Tempore 16:50:45, die 01/09/2005 AD, hinc in
xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Dionisio Ruiz de Zarate
<dionisio@xxxxxxxxxxxxx>:
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|