Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="html" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
- <xsl:template match="/" >
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Untitled Page</title>
- </head>
- <body>
- <style type="text/css">
- .smallline { height:10px; background:black; width:2px; margin:auto; }
- .box { border:1px solid #999; padding:10px; text-align:center; margin:auto; width:140px; }
- .wrapper { float:left; border:1px dotted green; }
- table { border-collapse:collapse; }
- td { vertical-align:top; height:10px; }
- </style>
- <xsl:apply-templates select="employees/employee" />
- </body>
- </html>
- </xsl:template>
- <xsl:template match="employee">
- <div class="wrapper">
- <div class="smallline" />
- <div class="box">
- <xsl:value-of select="name"/> <br/>
- <xsl:value-of select="title"/>
- </div>
- <xsl:if test="directReports/employee">
- <div class="smallline"> </div>
- <table>
- <tr>
- <xsl:for-each select="directReports/employee">
- <td> <xsl:apply-templates select="." /> </td>
- </xsl:for-each>
- </tr>
- </table>
- </xsl:if>
- </div>
- </xsl:template>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment