Closed Bug 463324 Opened 18 years ago Closed 13 years ago

xml process problem

Categories

(Core :: XSLT, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: francisco.cpg, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 It´s not generating a formatted html table using xml with xsl. Reproducible: Always Steps to Reproduce: File 1 - Let´s call "Carros.xml" ----------------------------------------------------------------------------- <?xml version='1.0'?> <?xml-stylesheet type="text/xsl" href="modelos_ordenados_s_repet5.xsl"?> <tabela> <carro marca='Aston Martin'> <modelo>Aston Martin Db9</modelo> <ano>2007</ano> <valor>390483</valor> </carro> <carro marca='Aston Martin'> <modelo>Aston Martin Db9</modelo> <ano>2006</ano> <valor>359672</valor> </carro> </tabela> ----------------------------------------------------------------------------- File 2 Let´s call "modelos_ordenados_s_repet5.xsl" <?xml version='1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html"/> <xsl:template match="tabela"> <html> <header>Tabela Carros</header> <body> <table border='1' cellspacing='0' cellpadding='0'> <tr> <td width='200'>Marca</td><td width='300'>Modelo</td> <td width='100'>Ano</td><td width='100'>Valor</td> </tr> <xsl:for-each select="carro"> <xsl:sort select="@marca"/> <tr> <xsl:apply-templates select="."/> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> <xsl:template match="carro"> <tr> <td><font> <xsl:value-of select="@marca"/> </font></td> <td><xsl:value-of select="modelo"/></td> <td><xsl:value-of select="valor"/></td> <td><xsl:value-of select="ano"/></td> </tr> </xsl:template> </xsl:stylesheet> Actual Results: We are using file 2 "modelos_ordenados_s_repet5.xsl" to process file 1 "Carros.xml" with line <?xml-stylesheet type="text/xsl" href="modelos_ordenados_s_repet5.xsl"?> and generated a html formatted table. But, only in firefox, it´s generating an unformatted table. i.e. is working. Expected Results: It generates a formatted html table.
This is a mass search for bugs which are in the Firefox General component, are UNCO, have not been changed for 500 days and have an unspecified version. Reporter, can you please update to Firefox 3.6.10 or later, create a fresh profile, http://support.mozilla.com/en-US/kb/managing+profiles, and test again. If you still see the issue, please update this bug. If the issue is gone, please set the status to RESOLVED > WORKSFORME.
Whiteboard: [CLOSEME 2010-11-01]
I have tested and the issue still exists.
OS: Windows XP → All
Hardware: x86 → All
Version: unspecified → 3.6 Branch
Whiteboard: [CLOSEME 2010-11-01]
Component: General → XSLT
Product: Firefox → Core
Version: 3.6 Branch → unspecified
The problem is that you are double-nesting <tr> elements. The <xsl:for-each> loop puts a <tr> around each call to <xsl:apply-templates>, and then the template also creates a <tr> inside that. Removing one of the two makes things render fine here.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.