0

I have the following xslt and xml files:

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.dei.isep.ipp.pt/lprog">
    <xsl:template match="/">
        <html>
            <body>
                <h2>
                    LPROG relatório de <xsl:value-of select="paginaRosto/tema" />
                </h2>
                <h3>Grupo</h3>
                <table border="1">
                    <tr bgcolor="#9acd32">
                        <th style="text-align:left">Nome</th>
                        <th style="text-align:left">Número</th>
                        <th style="text-align:left">Mail</th>
                    </tr>
                    <xsl:for-each select="//autor">
                        <tr>
                            <td>
                                <xsl:value-of select="nome" />
                            </td>
                            <td>
                                <xsl:value-of select="número" />
                            </td>
                            <td>
                                <xsl:value-of select="mail" />
                            </td>
                        </tr>
                    </xsl:for-each>
                </table>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>

XML:

<?xml version="1.0" encoding="UTF-8"?>
<relatório xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    xmlns="http://www.dei.isep.ipp.pt/lprog" id="relatorio">
    <páginaRosto>
        <tema>Seguradora de Barcos</tema>
        <disciplina>
            <designação>Linguagens e Programação</designação>
            <anoCurricular>2</anoCurricular>
            <sigla>LPROG</sigla>
        </disciplina>
        <autor>
            <nome>Name 3</nome>
            <número>44223311</número>
            <mail>notarealuser3@isep.ipp.pt</mail>
        </autor>
        <autor>
            <nome>Name 2</nome>
            <número>43211</número>
            <mail>notarealuser2@isep.ipp.pt</mail>
        </autor>
    </páginaRosto>
</relatório>

I apologize being in different language but I suspect that my problem is related to special characters. I'm trying to convert, using xslt, to html from the xml. But I'm not able to get the data from the XML. I've already changed the match template to "/relatório" to make sure I match the root, and it is the same. Is here anything that is not right? What I'm missing here?

int3
  • 658
  • 1
  • 5
  • 21

1 Answers1

-1

Sorry, I was messing with the namespaces. I removed the xmlns and it worked.

int3
  • 658
  • 1
  • 5
  • 21