Advertisement
Guest User

Untitled

a guest
Nov 16th, 2010
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.45 KB | None | 0 0
  1.   <?xml version="1.0" encoding="ISO-8859-1" ?>
  2. - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. - <xsl:template match="/">
  4. - <html>
  5. - <head>
  6.   <title>Your Search Results</title>
  7.   <style>h2 {color: red; font-family: arial black; font-size: 30px; font-weight: bold;} .titlehead {color: red; font-family: arial; font-size: 15px; font-weight: bold;} .descrip {color: black; font-family: arial; font-size: 15px; font-weight: bold;} .decont {color: black; font-family: arial; font-size: 15px; font-weight: normal;}</style>
  8.   </head>
  9. - <body>
  10.   <h2>Your Search Results</h2>
  11. - <table width="40%" border="0" bgcolor="white" cellpadding="0" cellspacing="0">
  12. - <xsl:apply-templates select="catalog/item">
  13.   <xsl:sort select="title" />
  14.   </xsl:apply-templates>
  15.   </table>
  16.   </body>
  17.   </html>
  18.   </xsl:template>
  19. - <xsl:template match="item">
  20. - <p>
  21.   <xsl:apply-templates select="title" />
  22.   <xsl:apply-templates select="author" />
  23.   <xsl:apply-templates select="itnum" />
  24.   <xsl:apply-templates select="publisher" />
  25.   <xsl:apply-templates select="loanpe" />
  26.   <xsl:apply-templates select="year" />
  27.   </p>
  28.   </xsl:template>
  29. - <xsl:template match="title">
  30. - <tr>
  31. - <td bgcolor="#FBEC5D">
  32. - <font class="titlehead">
  33.   Title:
  34.   <xsl:value-of select="." />
  35.   </font>
  36.   <br />
  37.   </td>
  38.   </tr>
  39.   </xsl:template>
  40. - <xsl:template match="author">
  41. - <tr>
  42. - <td>
  43. - <font class="descrip">
  44.   Author:
  45. - <span class="decont">
  46.   <xsl:value-of select="." />
  47.   </span>
  48.   </font>
  49.   <br />
  50.   </td>
  51.   </tr>
  52.   </xsl:template>
  53. - <xsl:template match="itnum">
  54. - <tr>
  55. - <td>
  56. - <font class="descrip">
  57.   Item Number:
  58. - <span class="decont">
  59.   <xsl:value-of select="." />
  60.   </span>
  61.   </font>
  62.   <br />
  63.   </td>
  64.   </tr>
  65.   </xsl:template>
  66. - <xsl:template match="publisher">
  67. - <tr>
  68. - <td>
  69. - <font class="descrip">
  70.   Publisher:
  71. - <span class="decont">
  72.   <xsl:value-of select="." />
  73.   </span>
  74.   </font>
  75.   <br />
  76.   </td>
  77.   </tr>
  78.   </xsl:template>
  79. - <xsl:template match="loanpe">
  80. - <tr>
  81. - <td>
  82. - <font class="descrip">
  83.   Loan Period:
  84. - <span class="decont">
  85.   <xsl:value-of select="." />
  86.   </span>
  87.   </font>
  88.   <br />
  89.   </td>
  90.   </tr>
  91.   </xsl:template>
  92. - <xsl:template match="year">
  93. - <tr>
  94. - <td>
  95. - <font class="descrip">
  96.   Year Published:
  97. - <span class="decont">
  98.   <xsl:value-of select="." />
  99.   </span>
  100.   </font>
  101.   <br />
  102.   <br />
  103.   <br />
  104.   </td>
  105.   </tr>
  106.   </xsl:template>
  107.   </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement