Salut Software Entwicklung

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

XML-Beispiel

 
<?xml version="1.0" standalone="yes"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="selection"/>
<xsl:output method="html" encoding="ASCII"/>

<xsl:template match="paragraph">
    <TABLE border="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%" HEIGHT="420">
    <TR>
    <TD WIDTH="48"  HEIGHT="48" valign="bottom"><img src="{pathtoroot}/images/tablea1.jpg" border="0" width="48" height="48" /></TD>
    <TD WIDTH="90%" HEIGHT="48" valign="bottom" background="{pathtoroot}/images/tableb1.jpg"><p class="ueberschrift"><xsl:value-of select="heading" disable-output-escaping="yes" /></p></TD>
    <TD WIDTH="48"  HEIGHT="48" valign="bottom"><img src="{pathtoroot}/images/tablec1.jpg" border="0" width="48" height="48" /></TD>
    </TR>
    <TR>
    <TD WIDTH="48" height="80%" valign="bottom" background="{pathtoroot}/images/tablea2.jpg"><xsl:text  disable-output-escaping="yes">& </xsl:text></TD>
    <TD bgcolor="#E6E5F3" valign="top">

    <xsl:value-of select="mytext" disable-output-escaping="yes" />
    <xsl:text disable-output-escaping="yes">& </xsl:text>
    </TD>

    <TD WIDTH="48" valign="bottom" background="{pathtoroot}/images/tablec2.jpg"><xsl:text  disable-output-escaping="yes">& </xsl:text></TD>
    </TR>
    <TR>
    <TD WIDTH="48"  HEIGHT="55" valign="bottom"><img src="{pathtoroot}/images/tablea3.jpg" border="0" width="48" height="55" /></TD>
    <TD WIDTH="90%" HEIGHT="55" background="{pathtoroot}/images/tableb3.jpg"><xsl:text disable-output-escaping="yes">& </xsl:text></TD>
    <TD WIDTH="48"  HEIGHT="55" valign="bottom"><img src="{pathtoroot}/images/tablec3.jpg" border="0" width="48" height="55" /></TD>
    </TR>
    </TABLE>
</xsl:template>

<xsl:template match="main">

    <html>
    <head>
    <title>Salut- Internet- und Computer-Dienstleistung</title>
    <link rel="STYLESHEET" type="text/css" href="css/salut.css" />
    </head>
    <body bgcolor="White" marginheight="0"  marginwidth="0" leftmargin="0" topmargin="0">

    <table border="0" cellpadding="0" cellspacing="0" width="100%" heigh="100%">
    <tr>
    <td width="160" height="75" background="images/logo.jpg"><xsl:text  disable-output-escaping="yes">& </xsl:text></td>
    <td width="90%" height="75" background="images/backtop.jpg" border="0"><xsl:text  disable-output-escaping="yes">& </xsl:text></td>
    </tr>
    <tr>
    <td width="160" height="90%" valign="top" background="images/backleft.jpg">
   
    <table border="0" cellpadding="0" cellspacing="0" height="20"><tr><td><xsl:text disable-output-escaping="yes">& </xsl:text></td></tr></table>
    <xsl:apply-templates select="item"/>    
   
    </td>
    <td valign="top">

    <xsl:apply-templates select="document(descendant::item[@id=string($selection)]/@content)" />
    <xsl:apply-templates select="document(self::*[string($selection)='']/@content)" />
    <xsl:text disable-output-escaping="yes">& </xsl:text>
    </td></tr></table>

    <div style="position:absolute; top:450px; left:10px; width: 134px; height: 26px" id="copyright" align="left">  
    <p class="copy"><xsl:text disable-output-escaping="yes">&#169;1998-2008 by Salut</xsl:text></p>
    </div>

    </body>
    </html>
   
</xsl:template>

<xsl:template match="item" mode="leftborder">
    <xsl:apply-templates select="parent::item[following-sibling::*]" mode="leftborder"/>
    <xsl:apply-templates select="parent::item[not(following-sibling::*)]" mode="leftborderlast"/>
    <img src="images/ftv2blank.gif" border="0"/>
</xsl:template>

<xsl:template match="item" mode="leftborderlast">
    <xsl:apply-templates select="parent::item[following-sibling::*]" mode="leftborder"/>
    <xsl:apply-templates select="parent::item[not(following-sibling::*)]" mode="leftborderlast"/>
    <img src="images/ftv2blank.gif" border="0"/>
</xsl:template>

<xsl:template match="item" mode="text">
    <a href="{@filename}"><div class="menu"><xsl:value-of select="@entry"/></div></a>
</xsl:template>

<xsl:template match="item" mode="selectedtext">
    <a href="{parent::*[1]/@filename}"><div class="menuselected"><xsl:value-of select="@entry"/></div></a>
</xsl:template>

<xsl:template match="item[not(item) and not(following-sibling::*)]" mode="icons">
    <img src="images/ftv2lastnode.gif" border="0"/>    
    <!--<img src="images/ftv2doc.gif" border="0"/>-->
</xsl:template>

<xsl:template match="item[item  and not(following-sibling::*)]" mode="icons">
    <xsl:param name="icon"/>
    <xsl:param name="ref"/>
    <a href="{$ref}">
    <img src="images/ftv2{$icon}lastnode.gif" border="0"/>    
    <!--<img src="images/ftv2folder{$icon}.gif" border="0"/>--></a>
</xsl:template>

<xsl:template match="item[not(item) and following-sibling::*]" mode="icons">
    <img src="images/ftv2node.gif" border="0"/>    
    <!--<img src="images/ftv2doc.gif" border="0"/>-->
</xsl:template>

<xsl:template match="item[item and following-sibling::*]" mode="icons">
    <xsl:param name="icon"/>
    <xsl:param name="ref"/>
    <a href="{$ref}">
    <img src="images/ftv2{$icon}node.gif" border="0"/>    
    <!--<img src="images/ftv2folder{$icon}.gif" border="0"/>--></a>
</xsl:template>

<xsl:template match="item[@entry]">

    <table border="0" cellspacing="0" cellpadding="0" background="images/blank.gif">
    <tr><td>
    <xsl:apply-templates select="parent::item[following-sibling::*]" mode="leftborder"/>
    <xsl:apply-templates select="parent::item[not(following-sibling::*)]" mode="leftborderlast"/>
    <img src="images/ftv2blank.gif" />
    <!--
    <xsl:apply-templates mode="icons" select="self::*[not(starts-with($selection, @id))]">
    <xsl:with-param name="icon" select="'p'"/>
    <xsl:with-param name="ref" select="@filename"/>
    </xsl:apply-templates>

    <xsl:apply-templates mode="icons" select="self::*[starts-with($selection, @id)]">
    <xsl:with-param name="icon" select="'m'"/>
    <xsl:with-param name="ref" select="parent::*[1]/@filename"/>
    </xsl:apply-templates>
    -->

    <xsl:text disable-output-escaping="yes">& </xsl:text>
    </td><td align="left">
    <xsl:apply-templates select="self::*[@id=string($selection)]" mode="selectedtext"/>
    <xsl:apply-templates select="self::*[@id!=string($selection)]" mode="text"/></td></tr>
    </table>
    
    <xsl:if test="starts-with($selection, @id)">
        <xsl:apply-templates select="item" />
    </xsl:if>
</xsl:template>

</xsl:stylesheet>