1<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 2<!-- 3 @(#) $Id: MDB.xsl,v 1.4 2007-10-17 21:20:39 ifeghali Exp $ 4 --> 5<xsl:template match="/"> 6 <!-- --> 7 <html><head><title>Metabase DB Documentation</title> 8 <STYLE> 9 .titlemini { font-family: Arial, Helvetica, sans-serif; font-size: 15px; font-weight: normal; color: rgb(133, 133, 133); text-decoration: none; letter-spacing: 1px; line-height: 95%; } 10 .textmini { font-family: Arial, Helvetica, sans-serif; font-size: 10px; font-weight: normal; color: rgb(133, 133, 133); text-decoration: none; } 11 .tablemain { border: solid 0px; margin: solid 0px; } 12 .tableheader { padding: 3px; border: solid 0px; margin: 0px; background-color: rgb(235, 235, 235); font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: rgb(133, 133, 133); font-weight: bold; text-decoration: none; } 13 .tablebody { padding: 3px; border-top: solid 1px; border-left: solid 1px; border-bottom: solid 1px; border-right: solid 1px; border-color: rgb(210, 210, 210); margin: solid 0px; font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: rgb(133, 133, 133); text-decoration: none; } 14 </STYLE> 15 </head> 16 <body> 17 <!-- --> 18 <br/><span class="titlemini">database 19 <xsl:value-of select="database/name"/></span><br/><br/> 20 <TABLE class="tablemain"> 21 <xsl:for-each select="database/table"> 22 <xsl:call-template name="showtable"/> 23 </xsl:for-each> 24 </TABLE> 25 <!-- --> 26 </body></html> 27 <!-- --> 28</xsl:template> 29 30<xsl:template name="showtable"> 31 <tr><td colspan="4" class="tableheader"> <span class="titlemini">table 32 <xsl:value-of select="name"/></span> </td></tr> 33 <tr><td colspan="4"><span class="textmini"> 34 <xsl:value-of select="comments"/></span></td></tr> 35 36 <tr><td class="tableheader">field</td> 37 <td class="tableheader">type</td> 38 <td class="tableheader">comments</td> 39 <td class="tableheader">attributes</td> 40 </tr> 41 42 <xsl:for-each select="descendant::declaration/field"> 43 <xsl:call-template name="showfield"/> 44 </xsl:for-each> 45 46 <tr><td colspan="2" height="18"> </td> </tr> 47</xsl:template> 48 49<xsl:template name="showfield"> 50 <tr><td class="tablebody"><span class="textmini"> 51 <xsl:value-of select="name"/></span></td> 52 <td class="tablebody"><span class="textmini"> 53 <xsl:value-of select="type"/> 54 <xsl:for-each select="descendant::length"><xsl:call-template name="showlength"/> 55 </xsl:for-each> 56 </span></td> 57 58 <td class="tablebody"><span class="textmini"> 59 <xsl:value-of select="comments"/></span></td> 60 61 <td class="tablebody"><span class="textmini"> 62 <xsl:for-each select="descendant::default"><xsl:call-template name="showdefault"/> 63 </xsl:for-each> 64 65 <xsl:for-each select="descendant::autoincrement"><xsl:call-template name="showautoincrement"/> 66 </xsl:for-each> 67 68 <xsl:for-each select="descendant::unsigned"><xsl:call-template name="showunsigned"/> 69 </xsl:for-each> 70 71 <xsl:for-each select="descendant::notnull"><xsl:call-template name="shownotnull"/> 72 </xsl:for-each> 73 74 <xsl:variable name="curfield" select="current()/name"/> 75 76 <xsl:for-each select="following-sibling::index"> 77 <xsl:if test="$curfield=field/name"> 78 <br/>index <xsl:value-of select="name"/> 79 <xsl:if test="unique"> unique</xsl:if> 80 <xsl:if test="primary"> primary</xsl:if> 81 </xsl:if> 82 83 </xsl:for-each> 84 85 </span></td> 86 87 </tr> 88</xsl:template> 89 90<xsl:template name="showlength">(<xsl:value-of select="current()"/>) 91</xsl:template> 92 93<xsl:template name="showdefault"> 94 default=<xsl:value-of select="//default"/> 95</xsl:template> 96 97<xsl:template name="showautoincrement"> 98 autoincrement=<xsl:value-of select="//autoincrement"/> 99</xsl:template> 100 101<xsl:template name="showunsigned"> 102 unsigned=<xsl:value-of select="//unsigned"/> 103</xsl:template> 104 105<xsl:template name="shownotnull"> 106 notnull=<xsl:value-of select="//notnull"/> 107</xsl:template> 108 109</xsl:stylesheet> 110