| 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"/> |
|---|
| 4 | <xsl:template match="/"> |
|---|
| 5 | <html> |
|---|
| 6 | <head> |
|---|
| 7 | <title> |
|---|
| 8 | <xsl:for-each select="object"> |
|---|
| 9 | <xsl:value-of select="@name"/> |
|---|
| 10 | </xsl:for-each> |
|---|
| 11 | </title> |
|---|
| 12 | <link rel="stylesheet" type="text/css" media="all" |
|---|
| 13 | href="xsl.css" /> |
|---|
| 14 | </head> |
|---|
| 15 | <body> |
|---|
| 16 | <xsl:for-each select="object"> |
|---|
| 17 | <h2> |
|---|
| 18 | <xsl:value-of select="@name"/> |
|---|
| 19 | </h2> |
|---|
| 20 | <xsl:for-each select="action-provider"> |
|---|
| 21 | <xsl:sort select="@action_provider" |
|---|
| 22 | order="ascending" /> |
|---|
| 23 | <h1> |
|---|
| 24 | <xsl:value-of select="@name"/> |
|---|
| 25 | </h1> |
|---|
| 26 | <h2>Actions</h2> |
|---|
| 27 | <table> |
|---|
| 28 | <tr> |
|---|
| 29 | <th>Id</th> |
|---|
| 30 | <th>Title</th> |
|---|
| 31 | <th>Permission</th> |
|---|
| 32 | <th>Category</th> |
|---|
| 33 | <th>Visible</th> |
|---|
| 34 | </tr> |
|---|
| 35 | <xsl:for-each select="action"> |
|---|
| 36 | <xsl:sort select="@category" |
|---|
| 37 | order="ascending" /> |
|---|
| 38 | <xsl:variable name="color"> |
|---|
| 39 | <xsl:choose> |
|---|
| 40 | <xsl:when test="position() mod 2 = 0"> |
|---|
| 41 | <xsl:text>#ffffff</xsl:text> |
|---|
| 42 | </xsl:when> |
|---|
| 43 | <xsl:otherwise> |
|---|
| 44 | <xsl:text>#eeeeee</xsl:text> |
|---|
| 45 | </xsl:otherwise> |
|---|
| 46 | </xsl:choose> |
|---|
| 47 | </xsl:variable> |
|---|
| 48 | <tr style="background-color:{$color}"> |
|---|
| 49 | <td> |
|---|
| 50 | <xsl:value-of select="@action_id"/> |
|---|
| 51 | </td> |
|---|
| 52 | <td> |
|---|
| 53 | <xsl:value-of select="@title"/> |
|---|
| 54 | </td> |
|---|
| 55 | <td> |
|---|
| 56 | <xsl:for-each select="permission"> |
|---|
| 57 | <xsl:value-of select="@value"/> |
|---|
| 58 | </xsl:for-each> |
|---|
| 59 | </td> |
|---|
| 60 | <td> |
|---|
| 61 | <xsl:value-of select="@category"/> |
|---|
| 62 | </td> |
|---|
| 63 | <td> |
|---|
| 64 | <xsl:value-of select="@visible"/> |
|---|
| 65 | </td> |
|---|
| 66 | <xsl:for-each select="element"> |
|---|
| 67 | <td> |
|---|
| 68 | <xsl:value-of select="@value"/> |
|---|
| 69 | </td> |
|---|
| 70 | </xsl:for-each> |
|---|
| 71 | </tr> |
|---|
| 72 | <tr style="background-color:{$color}"> |
|---|
| 73 | <th>url_expression</th> |
|---|
| 74 | <td colspan="4"> |
|---|
| 75 | <xsl:value-of select="@url_expr"/> |
|---|
| 76 | </td> |
|---|
| 77 | </tr> |
|---|
| 78 | <tr style="background-color:{$color}"> |
|---|
| 79 | <th>condition_expression</th> |
|---|
| 80 | <td colspan="4"> |
|---|
| 81 | <xsl:value-of select="@condition_expr"/> |
|---|
| 82 | </td> |
|---|
| 83 | </tr> |
|---|
| 84 | </xsl:for-each> |
|---|
| 85 | </table> |
|---|
| 86 | </xsl:for-each> |
|---|
| 87 | </xsl:for-each> |
|---|
| 88 | </body> |
|---|
| 89 | </html> |
|---|
| 90 | </xsl:template> |
|---|
| 91 | </xsl:stylesheet> |
|---|