XML:
<#?xml version="1.0" encoding="UTF-8"?> <#?xml-stylesheet type="text/xsl" href="activitat2.xsl"?> <#videoclub> <#pelicula id="p1"> <#imagen >../img/los ojos del gato.jpg<#/imagen> <#titulo dir="http://gentetraslasparedes.blogspot.com.es/2012/06/los-ojos-del-gato-1985.html"> Los ojos del Gato <#/titulo> <#codigo>08556935674<#/codigo> <#genero>terror<#/genero> <#edad>+18<#/edad> <#director> Stephen King<#/director> <#/pelicula> <#pelicula id="p2"> <#imagen>../img/django.jpg<#/imagen> <#titulo dir="http://www.blogdecine.com/historias-de-cine/django-desencadenado-la-pelicula"> Django <#/titulo> <#codigo>085545332118<#/codigo> <#genero>accion<#/genero> <#edad>+18<#/edad> <#director> Quentin Tarantino <#/director> <#/pelicula> <#pelicula id="p3"> <#imagen>../img/the-conjuring.jpg<#/imagen> <#titulo dir="http://www.eleconomista.es/boxoffice/reports_usa/2013/the-conjuring-logra-asustar-con-mucha-fuerza-en-la-taquilla/"> The Conjuring<#/titulo> <#codigo>0855453098779<#/codigo> <#genero>terror<#/genero> <#edad>+18<#/edad> <#director> James Wan <#/director> <#/pelicula > <#/videoclub>
Y ahora su correspondiente XSL:
<#?xml version="1.0" encoding="UTF-8"?>
<#xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<#xsl:template match="/">
<#html>
<#head>
<#style type="text/css">
h1{color:#purple;}
th{text-align:center;padding:5px;color:#AFB890;}
table{text-align:left;color:#ffffff;background-color:#000000;padding:10px;}
a{ color:#AF0345;font-family:arial black; font-size:12px;text-align:center;}
a:hover{color:#F123AB;}
img{width:100px;height:100px;}
<#/style>
<#/head>
 <#body>
  <#h1>Videoclub<#/h1>
   <#table>
     <#tr>
     
     <#th>Imagen<#/th>
     <#th>Titulo<#/th>
     <#th>Codigo<#/th>
     <#th>Genero<#/th>
     <#th>Edad<#/th>
     <#th>Director<#/th>
     <#/tr>
     <#xsl:for-each select="videoclub/pelicula">
     <#tr>
     
      <#td>
      <#img>
           <#xsl:attribute name="src">
            <#xsl:value-of select="imagen"/>
           <#/xsl:attribute>
       <#/img>
      
      <#/td>
      <#td>
       <#a>
       
        <#xsl:attribute name="href">
         <#xsl:value-of select="titulo/@dir"/>
        <#/xsl:attribute>
        <#xsl:value-of select="titulo"/>
       <#/a>
      <#/td>
     
     
     
      <#td><#xsl:value-of select="codigo"/><#/td>
      <#td><#xsl:value-of select="genero"/><#/td>
      <#td><#xsl:value-of select="edad"/><#/td>
      <#td><#xsl:value-of select="director"/><#/td>
     <#/tr>
     <#/xsl:for-each>
   <#/table>
 <#/body>
<#/html>
<#/xsl:template>
<#/xsl:stylesheet>
Ejemplos creados por mi en XML-XSL
Aquí os dejo un mini videotutorial de programación web y posicionamiento



 
 
No hay comentarios:
Publicar un comentario