Database DTD

Tables DTD

Database XSL

Tables XSL

HTML example

Database definition:

Displaying file: dbdef.dtd

<!-- Definizione modello del documento: database -->
<!ELEMENT database (dbdes,dbname,dbcomm,dbext1,dbver,
dbverdate,dbauthor,dbgenerate*,dbprefix,
dbxmluri,dbsdluri,dbhtmluri?,dbhtmltmpluri?,dbddluri?,dbvb6uri?,
table*) >
<!ELEMENT dbdes (#PCDATA)>
<!ELEMENT dbname (#PCDATA)>
<!ELEMENT dbcomm (#PCDATA)>
<!ELEMENT dbext1 (#PCDATA)>
<!ELEMENT dbver (#PCDATA)>
<!ELEMENT dbverdate (#PCDATA)>
<!ELEMENT dbauthor (#PCDATA)>
<!ELEMENT dbgenerate (#PCDATA)>
<!ELEMENT dbprefix (#PCDATA)>
<!ELEMENT dbxmluri (#PCDATA)>
<!ELEMENT dbsdluri (#PCDATA)>
<!ELEMENT dbhtmluri (#PCDATA)>
<!ELEMENT dbhtmltmpluri (#PCDATA)>
<!ELEMENT dbddluri (#PCDATA)>
<!ELEMENT dbvb6uri (#PCDATA)>
<!ELEMENT table (tbname,tburi,tbgen)>
<!ELEMENT tbname (#PCDATA)>
<!ELEMENT tburi (#PCDATA)>
<!ELEMENT tbgen (#PCDATA)>

Definizione tabella:

Displaying file: tbdef.dtd

<!-- Definizione modello del documento: tabella/campi/indici -->
<!ELEMENT tbdef (tbdes,tbname,tbcomm,tbver,
tbverdate,tbhist*,tbauthor,tbtit,tbnew,tbric,tbprefix,tbaut,
tbfield+,tbindex*) >
<!ELEMENT tbdes (#PCDATA)>
<!ELEMENT tbname (#PCDATA)>
<!ELEMENT tbcomm (#PCDATA)>
<!ELEMENT tbver (#PCDATA)>
<!ELEMENT tbverdate (#PCDATA)>
<!ELEMENT tbhist (#PCDATA)>
<!ELEMENT tbauthor (#PCDATA)>
<!ELEMENT tbtit (#PCDATA)>
<!ELEMENT tbnew (#PCDATA)>
<!ELEMENT tbric (#PCDATA)>
<!ELEMENT tbprefix (#PCDATA)>
<!ELEMENT tbaut (#PCDATA)>

<!ELEMENT tbfield (fname,fcomment,ftype,fsize?,fdec?,fnotnull?,fdes,fdesshort,
foptions?,fvaluelist?,fdecodedata?)>
<!ELEMENT fname (#PCDATA)>
<!ELEMENT fcomment (#PCDATA)>
<!ELEMENT ftype (#PCDATA)>
<!ELEMENT fsize (#PCDATA)>
<!ELEMENT fdec (#PCDATA)>
<!ELEMENT fnotnull (#PCDATA)>
<!ELEMENT fdes (#PCDATA)>
<!ELEMENT fdesshort (#PCDATA)>

<!ELEMENT foptions (fox?,foy?,fowidth?,foheight?,foctrltype?,
fodisplay?,fosetinsert?,fosetupdate?,
fomask?,fopassword?,forange?,forequired?)>
<!ELEMENT fox (#PCDATA)>
<!ELEMENT foy (#PCDATA)>
<!ELEMENT fowidth (#PCDATA)>
<!ELEMENT foheight (#PCDATA)>
<!ELEMENT foctrltype (#PCDATA)>
<!ELEMENT fodisplay (#PCDATA)>
<!ELEMENT fosetinsert (#PCDATA)>
<!ELEMENT fosetupdate (#PCDATA)>
<!ELEMENT fomask (#PCDATA)>
<!ELEMENT fopassword (#PCDATA)>
<!ELEMENT forange (#PCDATA)>
<!ELEMENT forequired (#PCDATA)>

<!ELEMENT fvaluelist (fvx?,fvy?,fvwidth?,fvheight?,fvctrltype?,
fvform?)>
<!ELEMENT fvx (#PCDATA)>
<!ELEMENT fvy (#PCDATA)>
<!ELEMENT fvwidth (#PCDATA)>
<!ELEMENT fvheight (#PCDATA)>
<!ELEMENT fvctrltype (#PCDATA)>
<!ELEMENT fvform (#PCDATA)>

<!ELEMENT fdecodedata (fetable,fefield,fereturn+,
fdecodedes,fdecodecond,fdecodeoptions?)>
<!ELEMENT fetable (#PCDATA)>
<!ELEMENT fefield (#PCDATA)>
<!ELEMENT fereturn (#PCDATA)>
<!ELEMENT fdecodedes (#PCDATA)>
<!ELEMENT fdecodecond (#PCDATA)>
<!ELEMENT fdecodeoptions (fsx?,fsy?,fswidth?,fsheight?,fsctrltype?)>
<!ELEMENT fsx (#PCDATA)>
<!ELEMENT fsy (#PCDATA)>
<!ELEMENT fswidth (#PCDATA)>
<!ELEMENT fsheight (#PCDATA)>
<!ELEMENT fsctrltype (#PCDATA)>

<!ELEMENT tbindex (iname,icomment?,ifield+,iunique,iprimary,iautoincr?)>
<!ELEMENT iname (#PCDATA)>
<!ELEMENT icomment (#PCDATA)>
<!ELEMENT ifield (#PCDATA)>
<!ELEMENT iunique (#PCDATA)>
<!ELEMENT iprimary (#PCDATA)>
<!ELEMENT iautoincr (#PCDATA)>

xsl database:

Displaying file: dbdef.xsl

<?xml version='1.0'?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/TR/WD-xsl"
xmlns="http://www.w3.org/TR/REC-html40"
result-ns="">
<!--
Copyright 2000 Simeosoft
http://www.simeosoft.com/
MODIF: aggiungere ciclo su generate (o togliere tag)
-->

<!-- default rule -->

<xsl:template><xsl:apply-templates/></xsl:template>

<!-- root rule -->
<xsl:template match="/">
<!-- Build the HTML page -->
<HTML>
<HEAD>
<TITLE><xsl:value-of select="/database/dbdes"/></TITLE>
<STYLE>
P.intest {font-family : Arial;
font-size : 14pt;
font-weight : bold;
text-align: center;
font-style : italic}
.nome {font-family : Arial;
font-size : 12pt;
font-weight : bold;
font-style : normal}
.intesttab {font-family : Arial;
font-size : 10pt;
text-align: center;
font-weight : bold;
font-style : italic}
.generic {font-family : Arial;
font-size : 10pt;
font-weight : bold;
font-style : italic}
.dati {font-family : Arial;
font-size : 8pt;
font-style : normal}
.commento {font-family : Arial;
font-size : 8pt;
font-style : italic}
</STYLE>
</HEAD>
<BODY>
<P class="intest"><xsl:value-of select="database/dbdes"/></P>
<P class="dati">Database: <DIV class="nome">
<xsl:value-of select="database/dbname"/></DIV></P>
<P class="intest">dati generici:</P>
<TABLE BORDER="0">
<TR>
<TD class="dati">descrizione:</TD>
<TD class="generic"><xsl:value-of select="database/dbdes"/></TD>
</TR>
<TR>
<TD class="dati">nome:</TD>
<TD class="generic"><xsl:value-of select="database/dbname"/></TD>
</TR>
<TR>
<TD class="dati">commento:</TD>
<TD class="generic"><xsl:value-of select="database/dbcomm"/></TD>
</TR>
<TR>
<TD class="dati">estensione 1:</TD>
<TD class="generic"><xsl:value-of select="database/dbext1"/></TD>
</TR>
<TR>
<TD class="dati">versione:</TD>
<TD class="generic"><xsl:value-of select="database/dbver"/></TD>
</TR>
<TR>
<TD class="dati">data versione:</TD>
<TD class="generic"><xsl:value-of select="database/dbverdate"/></TD>
</TR>
<TR>
<TD class="dati">autore:</TD>
<TD class="generic"><xsl:value-of select="database/dbauthor"/></TD>
</TR>
<TR>
<TD class="dati">generazione di tipo:</TD>
<TD class="generic"><xsl:value-of select="database/dbgenerate"/></TD>
</TR>
<TR>
<TD class="dati">prefisso:</TD>
<TD class="generic"><xsl:value-of select="database/dbprefix"/></TD>
</TR>
<TR>
<TD class="dati">URI xml:</TD>
<TD class="generic"><xsl:value-of select="database/dbxmluri"/></TD>
</TR>
<TR>
<TD class="dati">URI sdl:</TD>
<TD class="generic"><xsl:value-of select="database/dbsdluri"/></TD>
</TR>
<TR>
<TD class="dati">URI html:</TD>
<TD class="generic"><xsl:value-of select="database/dbhtmluri"/></TD>
</TR>
<TR>
<TD class="dati">URI templates html:</TD>
<TD class="generic"><xsl:value-of select="database/dbxmltmpluri"/></TD>
</TR>
<TR>
<TD class="dati">URI ddl:</TD>
<TD class="generic"><xsl:value-of select="database/dbddluri"/></TD>
</TR>
<TR>
<TD class="dati">URI Visual Basic:</TD>
<TD class="generic"><xsl:value-of select="database/dbvb6uri"/></TD>
</TR>
</TABLE>
<P class="intest">Tabelle:</P>
<xsl:apply-templates select="database/table"/>
</BODY>
</HTML>
</xsl:template>

<xsl:template match="table">
<P class="generic">
<A><xsl:attribute name="href">
<xsl:value-of select="tburi"/>
</xsl:attribute>
<xsl:apply-templates select="tbname"/>
</A>
</P>
</xsl:template>

<xsl:template match="tbname">
<xsl:value-of/>
</xsl:template>

</xsl:stylesheet>

xsl tabella:

Displaying file: tbdef.xsl

<?xml version='1.0'?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/TR/WD-xsl"
xmlns="http://www.w3.org/TR/REC-html40"
result-ns="">
<!--
Copyright 2000 Simeosoft
http://www.simeosoft.com/
-->
<!-- root rule -->
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE><xsl:value-of select="tbdef/tbdes"/></TITLE>
<STYLE>
P.intest {font-family : Arial;
font-size : 14pt;
font-weight : bold;
text-align: center;
font-style : italic}
.nome {font-family : Arial;
font-size : 12pt;
font-weight : bold;
font-style : normal}
.intesttab {font-family : Arial;
font-size : 10pt;
text-align: center;
font-weight : bold;
font-style : italic}
.generic {font-family : Arial;
font-size : 10pt;
font-weight : bold;
font-style : italic}
.dati {font-family : Arial;
font-size : 8pt;
font-style : normal}
.commento {font-family : Arial;
font-size : 8pt;
font-style : italic}
</STYLE>

<xsl:apply-templates/>
</HEAD>
</HTML>
</xsl:template>

<xsl:template match="tbdef">
<BODY>
<P class="intest">tabella: <xsl:value-of select="tbname"/></P>
<P class="intest">dati generici:</P>
<TABLE BORDER="0">
<TR>
<TD class="dati">descrizione:</TD>
<TD class="generic"><xsl:value-of select="tbdes"/></TD>
</TR>
<TR>
<TD class="dati">nome:</TD>
<TD class="generic"><xsl:value-of select="tbname"/></TD>
</TR>
<TR>
<TD class="dati">commento:</TD>
<TD class="generic"><xsl:value-of select="tbcomm"/></TD>
</TR>
<TR>
<TD class="dati">versione:</TD>
<TD class="generic"><xsl:value-of select="tbver"/></TD>
</TR>
<TR>
<TD class="dati">data versione:</TD>
<TD class="generic"><xsl:value-of select="tbverdate"/></TD>
</TR>
<!-- hist -->
<xsl:apply-templates select="tbhist"/>
<TR>
<TD class="dati">autore:</TD>
<TD class="generic"><xsl:value-of select="tbauthor"/></TD>
</TR>
<TR>
<TD class="dati">link di gestione:</TD>
<TD class="generic"><xsl:value-of select="tbtit"/></TD>
</TR>
<TR>
<TD class="dati">link nuovo elemento:</TD>
<TD class="generic"><xsl:value-of select="tbnew"/></TD>
</TR>
<TR>
<TD class="dati">link ricerca:</TD>
<TD class="generic"><xsl:value-of select="tbric"/></TD>
</TR>
<TR>
<TD class="dati">prefisso:</TD>
<TD class="generic"><xsl:value-of select="tbprefix"/></TD>
</TR>
<TR>
<TD class="dati">aggiornamento automatico:</TD>
<TD class="generic"><xsl:value-of select="tbaut"/></TD>
</TR>
</TABLE>
<HR></HR>
<P class="intest">dettaglio campi:</P>
<TABLE border="0">
<TR>
<TD class="intesttab">nome campo</TD>
<TD class="intesttab">tipo</TD>
<TD class="intesttab">dim.</TD>
<TD class="intesttab">dec.</TD>
<TD class="intesttab">not null?</TD>
<TD class="intesttab">descrizione</TD>
<TD class="intesttab">des.breve</TD>
</TR>
<xsl:apply-templates select="tbfield"/>
</TABLE>
<HR></HR>
<P class="intest">dettaglio indici:</P>
<TABLE border="0">
<TR>
<TD class="intesttab">nome indice</TD>
<TD class="intesttab">campi</TD>
<TD class="intesttab">unique?</TD>
<TD class="intesttab">primary?</TD>
<TD class="intesttab">autoincr?</TD>
</TR>
<xsl:apply-templates select="tbindex"/>
</TABLE>
<HR></HR>
</BODY>
</xsl:template>

<xsl:template match="tbfield">
<TR>
<TD class="nome"><xsl:value-of select="fname"/></TD>
<TD class="dati"><xsl:value-of select="ftype"/></TD>
<TD class="dati"><xsl:value-of select="fsize"/></TD>
<TD class="dati"><xsl:value-of select="fdec"/></TD>
<TD class="dati"><xsl:value-of select="fnotnull"/></TD>
<TD class="dati"><xsl:value-of select="fdes"/></TD>
<TD class="dati"><xsl:value-of select="fdesshort"/></TD>
</TR>
<TR>
<TD colspan="7" class="commento"><xsl:value-of select="fcomment"/></TD>
</TR>
</xsl:template>

<xsl:template match="tbindex">
<TR>
<TD class="nome"><xsl:value-of select="iname"/></TD>
<TD class="dati"><xsl:apply-templates select="ifield"/></TD>
<TD class="dati"><xsl:value-of select="iunique"/></TD>
<TD class="dati"><xsl:value-of select="iprimary"/></TD>
<TD class="dati"><xsl:value-of select="iautoincr"/></TD>
</TR>
<TR>
<TD colspan="5" class="commento"><xsl:value-of select="icomment"/></TD>
</TR>
</xsl:template>

<xsl:template match="ifield">
[<xsl:value-of select="."/>]
</xsl:template>

<xsl:template match="tbhist">
<TR>
<TD class="dati">history log:</TD>
<TD class="generic"><xsl:value-of select="."/></TD>
</TR>
</xsl:template>

</xsl:stylesheet>