mihai-rotaru

movies-style.xsl

Nov 26th, 2011
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.12 KB | None | 0 0
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet
  3.    version="1.0"
  4.    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
  5.     <xsl:template match="/">
  6.         <!--XHTML generation begins here-->
  7.         <html>
  8.             <body>
  9.                 <h2>A list of movies</h2>
  10.                 <p>This list comprises several randomly selected movies</p>
  11.                 <table>
  12.  
  13.                     <!--Generate table headings-->
  14.                     <tr>
  15.                         <th>Title</th>
  16.                         <th>Year</th>
  17.                         <th>Rating</th>
  18.                     </tr>
  19.  
  20.                     <!--Generate table rows-->
  21.                     <xsl:for-each select="movies/movie">
  22.                         <tr>
  23.                             <td><xsl:value-of select="title"/></td>
  24.                             <td><xsl:value-of select="year"/></td>
  25.                             <td><xsl:value-of select="rating"/></td>
  26.                         </tr>
  27.                     </xsl:for-each>
  28.                 </table>
  29.             </body>
  30.         </html>
  31.         <!--XHTML generation finishes here-->
  32.     </xsl:template>
  33. </xsl:stylesheet>
  34.  
  35.  
Add Comment
Please, Sign In to add comment