Ver Mensaje Individual
  #4 (permalink)  
Antiguo 28/12/2013, 07:20
marodal
 
Fecha de Ingreso: noviembre-2008
Ubicación: Sevilla
Mensajes: 157
Antigüedad: 15 años, 5 meses
Puntos: 2
Respuesta: transformar xml con xsl y visualizarlo con navegador

Cita:
Iniciado por HackmanC Ver Mensaje
Hola,

Posiblemente el XSLT no tiene ni idea del Namespace, podrías probar a usar un Namespace,

Código:
<?xml version="1.0" encoding="windows-1252" ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns1="http://www.example.org">
  <xsl:template match="/">
    <html>
    <body>
    <h1>Peliculas</h1>
      <table width="100%" border="1">
        <tr>
          <th>Titulo</th>
          <th>Director</th>
          <th>Guionista</th>
          <th>Productor</th>
          <th>Actor Principal</th>
          <th>Comentarios</th>
        </tr>
        <xsl:for-each select="ns1:peliculas/ns1:pelicula">
        <tr>
          <td><xsl:value-of select="ns1:titulo"/>sdfsdf</td>
          <td><xsl:value-of select="ns1:director"/>sd</td>
          <td><xsl:value-of select="ns1:guionista"/>dsf</td>
          <td><xsl:value-of select="ns1:productor"/>sdf</td>
          <td><xsl:value-of select="ns1:actor"/>dsf</td>
          <td><xsl:value-of select="ns1:comentarios"/>sdf</td>
        </tr>
        </xsl:for-each>
      </table>
    </body>
    </html>
  </xsl:template>
</xsl:stylesheet>
Saludos,

Efectivamente, había problemas con el espacio de nombres. No quiero complicarme con esto, así que directamente lo he quitado del documento xml. Ahora se visualiza sin problemas.

Muchisimas gracias