Guest User

Untitled

a guest
Feb 4th, 2010
1,460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.51 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.   <xsl:output method="html" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
  4.     <xsl:template match="/" >
  5.       <html xmlns="http://www.w3.org/1999/xhtml">
  6.         <head>
  7.           <title>Untitled Page</title>
  8.         </head>
  9.         <body>
  10.           <style type="text/css">
  11.             .smallline { height:10px; background:black; width:2px; margin:auto; }
  12.             .box { border:1px solid #999; padding:10px; text-align:center; margin:auto; width:140px; }
  13.             .wrapper  { float:left; border:1px dotted green; }
  14.             table { border-collapse:collapse; }
  15.             td { vertical-align:top; height:10px; }
  16.           </style>
  17.           <xsl:apply-templates select="employees/employee" />
  18.         </body>
  19.       </html>
  20.     </xsl:template>
  21.     <xsl:template match="employee">
  22.       <div class="wrapper">
  23.         <div class="smallline" />
  24.         <div class="box">
  25.           <xsl:value-of select="name"/> <br/>
  26.           <xsl:value-of select="title"/>
  27.         </div>
  28.         <xsl:if test="directReports/employee">
  29.           <div class="smallline"> </div>
  30.           <table>
  31.             <tr>
  32.               <xsl:for-each select="directReports/employee">
  33.                 <td> <xsl:apply-templates select="."  /> </td>
  34.               </xsl:for-each>
  35.             </tr>
  36.           </table>
  37.         </xsl:if>
  38.       </div>
  39.     </xsl:template>
  40. </xsl:stylesheet>
  41.  
Advertisement
Add Comment
Please, Sign In to add comment