Last active
March 31, 2020 11:19
-
-
Save showwin/8922875c6d7a29fdda3a7af9b65f9268 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf8"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s="http://sqlfairy.sourceforge.net/sqlfairy.xml"> | |
<xsl:output method="html" encoding="utf8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/> | |
<xsl:template match="database"> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"/> | |
<title>テーブル定義</title> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/> | |
<style> | |
html body { | |
font-family: sans-serif !important;; | |
} | |
table.htable { | |
margin: 3em auto 1em auto !important; | |
} | |
table.htable th { | |
border-left: 10px solid #e5e5e5 !important; | |
} | |
footer { | |
border-top: 1px solid #e5e5e5; | |
padding: 0.5em; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container"> | |
<h1 class="page-header">テーブル定義</h1> | |
<xsl:apply-templates select="table_structure"/> | |
</div> | |
<footer class="text-center"> | |
Created by showwin. | |
</footer> | |
</body> | |
</html> | |
</xsl:template> | |
<xsl:template match="table_structure"> | |
<table class="table table-bordered htable"> | |
<tbody> | |
<tr class="active"> | |
<th>テーブル名</th> | |
<td><xsl:value-of select="@name"/></td> | |
<td><xsl:apply-templates select="options"/></td> | |
</tr> | |
</tbody> | |
</table> | |
<table class="table table-condensed"> | |
<thead> | |
<tr> | |
<th class="text-right">#</th> | |
<th>物理名</th> | |
<th>論理名</th> | |
<th>型</th> | |
<th>NULL</th> | |
<th>デフォルト値</th> | |
<th>主キー</th> | |
<th>ユニーク</th> | |
<th>その他</th> | |
</tr> | |
</thead> | |
<tbody> | |
<xsl:apply-templates select="field"/> | |
</tbody> | |
</table> | |
</xsl:template> | |
<xsl:template match="field"> | |
<tr> | |
<td class="text-right"><xsl:value-of select="position()"/></td> | |
<td><xsl:value-of select="@Field"/></td> | |
<td><xsl:value-of select="@Comment"/></td> | |
<td><xsl:value-of select="@Type"/></td> | |
<td><xsl:if test="@Null='YES'"><span class="glyphicon glyphicon-ok"></span></xsl:if></td> | |
<td><xsl:value-of select="@Default"/></td> | |
<td><xsl:if test="@Key='PRI'"><span class="glyphicon glyphicon-ok"></span></xsl:if></td> | |
<td><xsl:if test="@Key='UNI'"><span class="glyphicon glyphicon-ok"></span></xsl:if></td> | |
<td><xsl:value-of select="@Extra"/></td> | |
</tr> | |
</xsl:template> | |
<xsl:template match="options"> | |
<xsl:value-of select="@Comment"/> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MMMのx-bloodです。こちら再利用させて頂きました。
ありがとうございます。 🙇♂️