Titel Dokumentation Spezifikation DTD Template XML  XSL Implementierung Projekte

Fragen und Antworten  zu Friedrich Nietzsche  XSL-Stylesheet
 
<!-- 04.04.2001 - Patrick Cernko -->
<!-- Stylesheet fuer die XML-Files: Fragen und Antworten zu Friedrich Nietzsche -->

<?xml version="1.0"  encoding="iso-8859-1" standalone="yes"?>

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns="http://www.w3.org/TR/REC-html40/loose.dtd">


  <xsl:variable name="werkurl">http://nietzsche.ps.uni-sb.de/werke/xsl/</xsl:variable>
  <xsl:variable name="personurl">http://nietzsche.ps.uni-sb.de/pers/xsl/</xsl:variable>
  <xsl:variable name="briefurl">http://nietzsche.ps.uni-sb.de/briefe/draft/</xsl:variable>
  <xsl:variable name="orturl">http://nietzsche.ps.uni-sb.de/orte/draft/</xsl:variable>
  <xsl:variable name="extrakturl">http://nietzsche.ps.uni-sb.de/extrakte/draft/</xsl:variable>
  <xsl:variable name="quelleurl">http://nietzsche.ps.uni-sb.de/quelle/draft/</xsl:variable>
  <xsl:variable name="faqurl">http://nietzsche.ps.uni-sb.de/faq/xsl/</xsl:variable>

  <xsl:variable name="personpfad">/home/httpd/nietzsche/pers/draft/</xsl:variable>
  <xsl:variable name="designfile">
    <xsl:value-of select="/faq/head/design/@id"/>
    <xsl:text>.xml</xsl:text>
  </xsl:variable>
  <xsl:variable name="designpfad">
    <xsl:value-of select="$personpfad"/>
    <xsl:value-of select="$designfile"/>
  </xsl:variable>
  <xsl:variable name="designurl">
    <xsl:value-of select="$personurl"/>
    <xsl:value-of select="$designfile"/>
  </xsl:variable>
  <xsl:variable name="autorfile">
    <xsl:value-of select="/faq/head/autor/@id"/>
    <xsl:text>.xml</xsl:text>
  </xsl:variable>
  <xsl:variable name="autorpfad">
    <xsl:value-of select="$personpfad"/>
    <xsl:value-of select="$autorfile"/>
  </xsl:variable>
  <xsl:variable name="autorurl">
    <xsl:value-of select="$personurl"/>
    <xsl:value-of select="$autorfile"/>
  </xsl:variable>
  <xsl:variable name="designname">
    <xsl:value-of select="document($designpfad)/per/body/name/vorname"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select="document($designpfad)/per/body/name/nachname"/>
  </xsl:variable>
  <xsl:variable name="autorname">
    <xsl:value-of select="document($autorpfad)/per/body/name/vorname"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select="document($autorpfad)/per/body/name/nachname"/>
  </xsl:variable>

  <xsl:param name="erweitert"/>





  <xsl:template match="/faq">
    <xsl:choose>
      <xsl:when test="$erweitert!=''">
        <xsl:call-template name="erweitertlayout"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="normallayout"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>



  <xsl:template match="body">
    <h2>
      <xsl:value-of select="frage"/> ?
    </h2>

    <xsl:apply-templates select="antwort"/>
  </xsl:template>



  <xsl:template match="antwort">
    <xsl:apply-templates/>
  </xsl:template>



  <xsl:template match="p">
    <p>
      <xsl:apply-templates/>
    </p>
  </xsl:template>



  <xsl:template match="hinweis">
    <b>
      <xsl:apply-templates/>
    </b>
  </xsl:template>



  <xsl:template match="betont">
    <i>
      <xsl:apply-templates/>
    </i>
  </xsl:template>



   <xsl:template match="erweitert" mode="newwindow">
    <xsl:variable name="nummer">
      <xsl:number level="any"/>
    </xsl:variable>

    <xsl:if test="$erweitert=$nummer">
      <h4>
        <sup class="kommentare">
          <xsl:number level="any"/>
        </sup>
        <xsl:text>&#160;</xsl:text>
        <xsl:choose>
          <xsl:when test="beschriftung!=''">
            <xsl:apply-templates select="beschriftung" mode="textfuss"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:text>... ausserdem ...</xsl:text>
          </xsl:otherwise>
        </xsl:choose>
      </h4>

      <!-- Kommentartext -->
      <p><xsl:apply-templates/></p>
      <!-- <xsl:apply-templates select="p"/> -->

      <xsl:apply-templates select=".." mode="kommentar"/>
    </xsl:if>
  </xsl:template>



  <xsl:template match="erweitert">
    <a>
      <xsl:attribute name="href">
        <xsl:text>javascript:popup(&apos;</xsl:text>
        <xsl:value-of select="$faqurl"/>
        <xsl:value-of select="/faq/@id"/>
        <xsl:text>.xml?erweitert=</xsl:text>
        <xsl:number level="any"/>
        <xsl:text>&apos;);</xsl:text>
      </xsl:attribute>

      <xsl:if test="beschriftung!=''">
        <xsl:apply-templates select="beschriftung" mode="inline"/>
      </xsl:if>

      <xsl:text>&#160;</xsl:text>
      <sup class="kommentare">
        <xsl:number level="any"/>
      </sup>
    </a>
  </xsl:template>



  <xsl:template match="beschriftung" mode="inline">
    <i>
      <xsl:apply-templates/>
    </i>
  </xsl:template>



  <xsl:template match="beschriftung" mode="textfuss">
    <xsl:apply-templates/>
  </xsl:template>



  <xsl:template match="beschriftung"/>



  <xsl:template match="br">
    <br/>
  </xsl:template>



  <xsl:template match="sprache">
    <i>
      <xsl:apply-templates/>
    </i>
  </xsl:template>



  <xsl:template match="wichtig">
    <b>
      <xsl:apply-templates/>
    </b>
  </xsl:template>



  <xsl:template match="ul">
    <ul>
      <xsl:apply-templates/>
    </ul>
  </xsl:template>



  <xsl:template match="ol">
    <ol>
      <xsl:apply-templates/>
    </ol>
  </xsl:template>



  <xsl:template match="li">
    <li>
      <xsl:apply-templates/>
    </li>
  </xsl:template>



  <xsl:template match="ewerk_ref" mode="kommentar">
      <p class="kommentarquelle">
        <xsl:text>[</xsl:text>
        <xsl:value-of select="@id"/>
        <xsl:text>]</xsl:text>
      </p>
  </xsl:template>



  <xsl:template match="*" mode="kommentar"/>



  <xsl:template match="ewerk_ref">
    <a>
      <xsl:attribute name="href">
        <xsl:value-of select="$werkurl"/>
        <xsl:value-of select="@id"/>
        <xsl:text>.xml</xsl:text>
      </xsl:attribute>
      <xsl:attribute name="target">Hauptfenster</xsl:attribute>
      <xsl:apply-templates/>
    </a>
  </xsl:template>



  <xsl:template match="per_ref">
    <a>
      <xsl:attribute name="href">
        <xsl:value-of select="$personurl"/>
        <xsl:value-of select="@id"/>
        <xsl:text>.xml</xsl:text>
      </xsl:attribute>
      <xsl:attribute name="target">Hauptfenster</xsl:attribute>
      <xsl:apply-templates/>
    </a>
  </xsl:template>



  <xsl:template match="brief_ref">
    <a>
      <xsl:attribute name="href">
        <xsl:value-of select="$briefurl"/>
        <xsl:value-of select="@id"/>
        <xsl:text>.xml</xsl:text>
      </xsl:attribute>
      <xsl:attribute name="target">Hauptfenster</xsl:attribute>
      <xsl:apply-templates/>
    </a>
  </xsl:template>



  <xsl:template match="ort_ref">
    <a>
      <xsl:attribute name="href">
        <xsl:value-of select="$briefurl"/>
        <xsl:value-of select="@id"/>
        <xsl:text>.xml</xsl:text>
      </xsl:attribute>
      <xsl:attribute name="target">Hauptfenster</xsl:attribute>
      <xsl:apply-templates/>
    </a>
  </xsl:template>



  <xsl:template match="extrakt_ref">
    <a>
      <xsl:attribute name="href">
        <xsl:value-of select="$briefurl"/>
        <xsl:value-of select="@id"/>
        <xsl:text>.xml</xsl:text>
      </xsl:attribute>
      <xsl:attribute name="target">Hauptfenster</xsl:attribute>
      <xsl:apply-templates/>
    </a>
  </xsl:template>



  <xsl:template match="quelle_ref">
    <a>
      <xsl:attribute name="href">
        <xsl:value-of select="$quelleurl"/>
        <xsl:value-of select="@id"/>
        <xsl:text>.xml</xsl:text>
      </xsl:attribute>
      <xsl:apply-templates/>
    </a>
  </xsl:template>



  <xsl:template match="faq_ref">
    <a>
      <xsl:attribute name="href">
        <xsl:value-of select="$faqurl"/>
        <xsl:value-of select="@id"/>
        <xsl:text>.xml</xsl:text>
      </xsl:attribute>
      <xsl:attribute name="target">Hauptfenster</xsl:attribute>
      <xsl:apply-templates/>
    </a>
  </xsl:template>




  <xsl:template match="extern_ref">
    <a>
      <xsl:attribute name="href">
        <xsl:value-of select="@href"/>
      </xsl:attribute>
      <xsl:attribute name="target">Hauptfenster</xsl:attribute>
      <xsl:apply-templates/>
      <xsl:text> (ext.)</xsl:text>
    </a>
  </xsl:template>




  <xsl:template match="datum" mode="inline">
    <xsl:value-of select="tag"/>
    <xsl:text>.</xsl:text>
    <xsl:value-of select="monat"/>
    <xsl:text>.</xsl:text>
    <xsl:value-of select="jahr"/>
  </xsl:template>










  <!-- Benamte Vorlagen zum Aufrufen -->
  <xsl:template name="normallayout">
    <html>
      <xsl:call-template name="html-head"/>
      <xsl:call-template name="html-body"/>
    </html>
  </xsl:template>



  <xsl:template name="html-head">
    <head>
      <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"/>
      <meta>
        <xsl:attribute name="name">author</xsl:attribute>
        <xsl:attribute name="content">
          <xsl:value-of select="$autorname"/>
        </xsl:attribute>
      </meta>
      <meta name="keywords" content="faq, faqs, fragen, antworten, friedrich, nietzsche"/>
      <meta name="description" content="Fragen und Antworten zu Friedrich Nietzsche."/>
      <title>
        <xsl:text>Nietzsche Online: </xsl:text>
        <xsl:value-of select="/faq/body/frage"/>
      </title>
      <link rel="stylesheet" type="text/css" href="/css/faq.css"/>
      <script language="JavaScript" src="funktionen.js"/>
    </head>
  </xsl:template>



  <xsl:template name="html-body">
    <body>
      <!-- Haupt-Tabelle -->
      <xsl:call-template name="maintable"/>
      <!-- Kommentare -->
      <!-- <xsl:call-template name="commenttable"/> -->
    </body>
  </xsl:template>



  <xsl:template name="maintable">
      <center>
        <table width="800pt" border="0" bgcolor="#EEEDEA"><tr><td align="center">
          &#160;<br/>
          <xsl:call-template name="headertable"/>
          <br/>
          <xsl:call-template name="contenttable"/>
          <br/>
          <xsl:call-template name="footertable"/>
        </td></tr></table>
      </center>
  </xsl:template>



  <xsl:template name="headertable-orginal">
    <!-- Header -->
    <table width="100%" border="0" cellpadding="5" cellspacing="5">
    <tr>
        <td rowspan="3" width="40" valign="middle">
          <div align="left">
            <img src="/img/nietzsche_left.gif"/>
          </div>
        </td>
        <td colspan="5" height="7"></td>
        <td rowspan="3" width="40" valign="middle">
          <div align="right">
            <img src="/img/nietzsche_right.gif"/>
          </div>
        </td>
    </tr>
    <tr>
        <td class="thema" nowrap="nowrap">
          <div align="center">
            <a href="/">Nietzsche Online</a>
          </div>
        </td>
        <td class="thema" nowrap="nowrap">
          <div align="center">
            <font color="#000080"><b>Antwort zur Frage</b></font>
          </div>
        </td>
        <td class="thema" nowrap="nowrap">
          <div align="center">
            <a href="../php/faq_sw.php">Schlagwortliste</a>
          </div>
        </td>
        <td class="thema" nowrap="nowrap">
          <div align="center">
            <a href="../php/faq_them.php">Themenliste</a>
          </div>
        </td>
        <td class="thema" nowrap="nowrap">
          <div align="center">
            <a href="../php/faq_all.html">Fragenliste</a>
          </div>
        </td>
    </tr>
    <tr>
      <td colspan="5" height="7"></td>
    </tr>
    </table>
    <!-- Ende Header -->
  </xsl:template>



  <xsl:template name="headertable">
    <!-- Header -->
<table width="100%" border="0" cellpadding="1"
        bordercolor="#8080C0">
<tr><td rowspan="3">&#160;</td>
    <td rowspan="3" width="40pt" align="center"
        valign="middle">&#160;
        <img src="../bilder/nietzsche_left.gif"/>&#160;</td>
    <td rowspan="3">&#160;</td>
    <td rowspan="3">&#160;</td>
    <td colspan="6">&#160;</td>
    <td rowspan="3">&#160;</td>
    <td rowspan="3">&#160;</td>
    <td rowspan="3" width="40pt" align="center"
        valign="middle">&#160;
        <img src="../bilder/nietzsche_right.gif"/>&#160;</td>
    <td rowspan="3">&#160;</td>
</tr>
<tr><td class="thema" align="center">&#160;<a
        href="../../.">Nietzsche&#160;Online</a>&#160;</td>
    <td class="thema" align="center">&#160;<font
        color="#000080"><b>Antwort&#160;zur&#160;Frage</b>
        </font>&#160;</td>
    <td class="thema" align="center">&#160;<a
        href="../php/faq_sw.php">Schlagwortliste</a>&#160;</td>
    <td class="thema" align="center">&#160;<a
        href="../php/faq_them.php">Themenliste</a>&#160;</td>
    <td class="thema" align="center">&#160;<a
        href="../php/faq_all.html">Fragenliste</a>&#160;</td>
</tr>
<tr><td colspan="6">&#160;</td></tr>
</table>
    <!-- Ende Header -->
  </xsl:template>



  <xsl:template name="footertable">
    <xsl:call-template name="headertable"/>
  </xsl:template>



  <xsl:template name="contenttable">
    <!-- Inhalt-Tabelle -->
    <table width="100%" border="0" cellpadding="20">
      <tr>
        <td width="20" valign="top">
          <xsl:call-template name="fragenundantwortenvertical"/>
        </td>
        <!-- Inhalt -->
        <td bgcolor="#FEFEFE">
          <xsl:call-template name="content"/>
        </td>
        <td width="20" valign="top">
          <xsl:call-template name="fragenundantwortenvertical"/>
        </td>
      </tr>
    </table>
    <!-- Ende Inhalt-Tabelle -->
  </xsl:template>

  <xsl:template name="fragenundantwortenvertical">
    <!-- Fragen und Antworten vertical -->
    <div align="top"><a href="../html/index.html"><i>
      F<br/>
      R<br/>
      A<br/>
      G<br/>
      E<br/>
      N<br/>
      &#160;<br/>
      U<br/>
      N<br/>
      D<br/>
      &#160;<br/>
      A<br/>
      N<br/>
      T<br/>
      W<br/>
      O<br/>
      R<br/>
      T<br/>
      E<br/>
      N<br/>
    </i></a></div>
    <!-- Ende Fragen und Antworten vertical -->
  </xsl:template>



  <xsl:template name="content">
    <!-- Eigentlicher Inhalt! -->
    <xsl:call-template name="thema"/>
    <xsl:apply-templates select="body"/>
    <xsl:call-template name="designautordatum"/>
  </xsl:template>



  <xsl:template name="thema">
    <div class="thema" align="right">
      <b>Thema: </b>
      <xsl:value-of select="/faq/head/thema"/>
    </div>
  </xsl:template>



  <xsl:template name="designautordatum">
    <!-- Designer, Autor & Datum -->
    <div class="copy" align="right">
      <font size="-2">
        <xsl:text>© Design </xsl:text>
        <a>
          <xsl:attribute name="href">
            <xsl:value-of select="$designurl"/>
          </xsl:attribute>
          <xsl:value-of select="$designname"/>
        </a>
        <br/>

        <xsl:text>© Inhalt </xsl:text>
        <a>
          <xsl:attribute name="href">
            <xsl:value-of select="$autorurl"/>
          </xsl:attribute>
          <xsl:value-of select="$autorname"/>
        </a>
        <br/>

        <xsl:text>letzte Änderung </xsl:text>
        <xsl:apply-templates select="/faq/head/design/datum"
        mode="inline"/>
        <br/>

        © 2001 <a href="http://www.uni-saarland.de">
        Universität des Saarlandes</a> -
        Fachrichtung <a href="http://is.uni-sb.de"> 5.6
        Informationswissenschaft</a>
      </font>
    </div>
    <!-- Ende Designer, Autor & Datum -->
  </xsl:template>



  <xsl:template name="commenttable">
    <!-- Kommentare -->
    <xsl:if test="count(//erweitert)!=0">
      <p class="spacer"/>

      <center>
        <table width="800pt" border="0" bgcolor="#EEEDEA"><tr><td align="center">
          <table  width="100%" border="0" cellpadding="20" style="margin-top:12px;">
            <tr>
              <td colspan="3">&#160;</td>
            </tr>
            <tr>
              <td width="20pt" valign="top">&#160;</td>
              <td bgcolor="#FEFEFE" valign="top">
                <!-- Alle Kommentare -->
                <xsl:apply-templates select="//erweitert" mode="textfuss"/>
              </td>
              <td width="20pt" valign="top">&#160;</td>
            </tr>
            <tr>
              <td colspan="3">&#160;</td>
            </tr>
          </table>
        </td></tr></table>
      </center>

      <p class="spacer"/>
    </xsl:if>
    <!-- Ende Kommentare -->
  </xsl:template>




  <xsl:template name="erweitertlayout">
    <html>
      <head>
        <link rel="stylesheet" type="text/css" href="/css/faq.css"/>
      </head>
      <body>
        <xsl:apply-templates select="//erweitert" mode="newwindow"/>
      </body>
    </html>
  </xsl:template>

</xsl:stylesheet>

 
© Layout Brigitte Jörg 
last modified  

Titel Dokumentation Spezifikation DTD Template XML  XSL Implementierung Projekte