Thomas J.S.: /SELFHTML: DocBook zur Generierung von Feature-Artikeln

Beitrag lesen

Hallo,

Wenn du die XML-Datei(en) zur Verfügung stellst, kann ich mir ansehen, was sich machen läßt.

Den aktuellen Arbeitsstand (noch nicht die endgültige Fassung) findest du unter [...]

Ich kann dir zwar jetzt ein XSL-Sheet geben, aber die Ergebnisse sind nicht allzu sehr zufriedenstellend. D.h. am Ende muss jemand  (eben du nach dem <I>-Prinzip, oder ein Redakteur) die entstandene HTML-Datei noch bearbeiten. Und vor allem: das XSL ist jetzt nur für die Dateien, die du zur Verfügung gestellt hast (wobei auch die Dokumentstrur der Dateien etwas anders ist als es für uns gut wäre)

Grüße Thomas

<?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xi="http://www.w3.org/2001/XInclude" version="1.0" exclude-result-prefixes="xi"> <xsl:output method="html" indent="yes" encoding="iso-8859-1" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" />     <xsl:template match="/article">   <html>    <head>     <title><xsl:value-of select="articleinfo/title" />: <xsl:value-of select="articleinfo/subtitle" /></title>     <meta name="description" content="{articleinfo/abstract/para}" />     <meta name="keywords" content="[Stichwort,Stichwort,...]" />     <meta name="author" content="{articleinfo/authorgroup/author/firstname} {articleinfo/authorgroup/author/surname}, {articleinfo/authorgroup/author/affiliation/address/email}" />     <meta name="DC.Publisher" content="[Vorname Nachname, mail@adresse.x]" />     <meta name="DC.Date" content="[jjjj-mm-ttThh:mm+01:00]" />     <meta name="DC.Identifier" content="[http://aktuell.de.selfhtml.org/artikel/bereich/artikel/index.htm]" />     <meta name="DC.Language" content="de" />     <meta name="DC.Rights" content="http://www.selfhtml.org/de.impressum.html" />     <meta name="SELF.Firstdate" content="[jjjj-mm-ttThh:mm+01:00]" />     <meta name="SELF.Version" content="1" />     <meta name="SELF.Pagetype" content="page" />     <link rel="stylesheet" title="SELFHTML Stylesheet" type="text/css" href="http://src.selfhtml.org/selfhtml.css" />     <link rel="shortcut icon" title="SELFHTML Icon" type="image/x-icon"  href="http://src.selfhtml.org/favicon.ico" />     <link rel="up" title="Feature-Artikel: [Feature-Artikel-Bereich]" href="../" />     <link rel="top" title="SELFHTML Aktuell" href="/" />     <link rel="search" title="SELF-Suche" href="http://suche.de.selfhtml.org/" />     <link rel="bookmark" href="/artikel/" title="Feature-Artikel" />     <link rel="bookmark" href="/links/" title="Linkverzeichnis" />     <link rel="bookmark" href="/tippstricks/" title="Tipps+Tricks" />    </head>

<body bgcolor="#FFFFFF" text="#000000" link="#AA5522" vlink="#772200" alink="#000000">

<!-- Obere Navigation -->     <table cellpadding="4" cellspacing="0" border="0" width="100%" summary=""><tr><td bgcolor="#FFEEDD" class="nav" colspan="2">     <a class="an" name="top"><img src="http://src.selfhtml.org/refkap.gif" width="16" height="13" border="0" alt="Teil von" /></a>&#160;<a href="../../../index.htm"><b>SELFHTML aktuell</b></a> <img src="http://src.selfhtml.org/refkap.gif" width="16" height="13" border="0" alt="Teil von" />&#160;<a href="../../index.htm"><b>Feature-Artikel</b></a> <img src="http://src.selfhtml.org/refkap.gif" width="16" height="13" border="0" alt="Teil von" /> <a href="../index.htm"><b>Bereich</b></a>     </td></tr></table>

<!-- Sichtbarer Seitenkopf -->     <table cellpadding="4" cellspacing="0" border="0" width="100%" summary=""><tr><td bgcolor="#EEEEEE" class="doc" width="110"><img src="http://src.selfhtml.org/logo.gif" width="106" height="109" border="0" alt="SELFHTML" /></td><td bgcolor="#EEEEEE" class="doc" valign="bottom" width="100%">

<!-- Sichtbare Seitenüberschrift -->     <h1 class="ph1"><xsl:value-of select="articleinfo/title" />: <xsl:value-of select="articleinfo/subtitle" /></h1>

</td></tr><tr>     <td bgcolor="#EEEEEE" class="doc" valign="top" align="center"><img src="http://src.selfhtml.org/dokx.gif" width="30" height="20" vspace="6" border="0" alt="Informationsseite" /></td><td bgcolor="#FFFFFF" valign="top" nowrap="nowrap">

<!-- Liste der Links zu den Unterkapiteln der Seite -->     <p>     <img src="http://src.selfhtml.org/down.gif" width="14" height="10" border="0" alt="nach unten" />&#160;<a href="#autor"><b><xsl:value-of select="concat(articleinfo/authorgroup/author/firstname, ' ', articleinfo/authorgroup/author/surname)" /></b></a><br />

<xsl:for-each select="document(xi:include/@href)/section">      <img src="http://src.selfhtml.org/down.gif" width="14" height="10" border="0" alt="nach unten" />&#160;<a href="#{@id}"><b><xsl:value-of select="title" /></b></a><br />     </xsl:for-each>     </p>

</td></tr>     <tr><td colspan="2" bgcolor="#EEEEEE" class="doc"><a href="#bottom"><img src="http://src.selfhtml.org/down.gif" width="14" height="10" border="0" alt="nach unten" /></a>&#160;</td></tr>     </table>     <!-- Ende Seitenkopf -->

<h2 class="Sh2"><a class="an" name="autor"><xsl:value-of select="concat(articleinfo/authorgroup/author/firstname, ' ', articleinfo/authorgroup/author/surname)" /></a></h2>

<table bgcolor="#EEEEEE" cellpadding="4" cellspacing="1">     <tr>     <th align="right" valign="top">E-Mail:</th>     <td valign="top"><img border="0" height="10" src="http://src.selfhtml.org/mail.gif" width="15" alt="E-Mail" />&#160;<a href="{articleinfo/authorgroup/author/affiliation/address/email}"><b><xsl:value-of select="articleinfo/authorgroup/author/affiliation/address/email" /></b></a></td>     </tr>     <tr>     <th align="right" valign="top">Homepage-URL:</th>     <td valign="top"><img src="http://src.selfhtml.org/de.gif" width="16" height="10" border="0" alt="deutschsprachig" />&#160;<a href="http://www.ihre-webadresse.de/" target="_top"><b>http://www.ihre-webadresse.de/</b></a></td>     </tr>     </table>

<p>Bei Fragen zu diesem Beitrag bitte den Autor des Beitrags kontaktieren!</p>

<table bgcolor="#EEEEEE" class="doc" width="100%" summary=""><tr><td><a href="#top"><img src="http://src.selfhtml.org/up.gif" width="14" height="10" border="0" alt="nach oben" /></a><a href="#bottom"><img src="http://src.selfhtml.org/down.gif" width="14" height="10" border="0" alt="nach unten" /></a>&#160;</td></tr></table>

<xsl:for-each select="document(xi:include/@href)">      <xsl:variable name="root" select="/" />      <xsl:apply-templates select="$root/section" />     </xsl:for-each>

<!-- Untere Navigation -->     <table cellpadding="4" cellspacing="0" border="0" width="100%" summary=""><tr><td bgcolor="#EEEEEE" class="doc"><a href="#top"><img src="http://src.selfhtml.org/up.gif" width="14" height="10" border="0" alt="nach oben" /></a></td></tr>     <tr><td bgcolor="#FFEEDD" class="nav"><img src="http://src.selfhtml.org/refkap.gif" width="16" height="13" border="0" alt="Teil von" />&#160;<a href="../../../index.htm"><b>SELFHTML aktuell</b></a> <img src="http://src.selfhtml.org/refkap.gif" width="16" height="13" border="0" alt="Teil von" />&#160;<a href="../../index.htm"><b>Feature-Artikel</b></a> <img src="http://src.selfhtml.org/refkap.gif" width="16" height="13" border="0" alt="Teil von" /> <a href="../index.htm"><b>Bereich</b></a></td></tr></table>

<p><a class="an" name="bottom">&#169; 2005</a> <img src="http://src.selfhtml.org/serverdoc.gif" width="15" height="10" border="0" alt="Seite" />&#160;<a href="http://www.selfhtml.org/de.impressum.html"><b>Impressum</b></a>, für diese Seite: <img src="http://src.selfhtml.org/mail.gif" width="15" height="10" border="0" alt="E-Mail" />&#160;<a href="{articleinfo/authorgroup/author/affiliation/address/email}"><xsl:value-of select="articleinfo/authorgroup/author/affiliation/address/email" /></a></p>

</body>   </html> </xsl:template> <xsl:template match="section[not(parent::section)]">   <h2 class="Sh2"><a class="an" name="{@id}"><xsl:value-of select="title" /></a></h2>   <xsl:apply-templates />   <table bgcolor="#EEEEEE" class="doc" width="100%" summary=""><tr><td><a href="#top"><img src="http://src.selfhtml.org/up.gif" width="14" height="10" border="0" alt="nach oben" /></a><a href="#bottom"><img src="http://src.selfhtml.org/down.gif" width="14" height="10" border="0" alt="nach unten" /></a>&#160;</td></tr></table> </xsl:template> <xsl:template match="section[parent::section]">   <h3 class="xpl"><xsl:value-of select="title" /></h3>   <xsl:apply-templates /> </xsl:template> <xsl:template match="para">   <p>    <xsl:apply-templates />   </p> </xsl:template> <xsl:template match="filename">   <var>    <xsl:apply-templates />   </var> </xsl:template> <xsl:template match="filename">   <em>    <xsl:apply-templates />   </em> </xsl:template> <xsl:template match="varname | function | example[not(screen)]">   <code>    <xsl:apply-templates />   </code> </xsl:template> <xsl:template match="command">   <kbd>    <xsl:apply-templates />   </kbd> </xsl:template> <xsl:template match="example[screen]">   <h3 class="xmp">Beispiel:</h3>   <table width="100%" cellpadding="10"><tr><td class="xmpcode" bgcolor="#FFFFE0"><pre>   <xsl:copy-of select="screen/text()" />   </pre></td></tr></table> </xsl:template> <xsl:template match="text()" /> <xsl:template match="para//text()">   <xsl:call-template name="cr2br">    <xsl:with-param name="text" select="." />   </xsl:call-template> </xsl:template> <xsl:template name="cr2br">   <xsl:param name="text" />    xsl:choose    <xsl:when test="contains($text, '&#xA;')">     <xsl:value-of select="substring-before($text, '&#xA;')" />     <br />     <xsl:call-template name="cr2br">      <xsl:with-param name="text" select="substring-after($text, '&#xA;')" />     </xsl:call-template>    </xsl:when>    xsl:otherwise     <xsl:value-of select="$text" />    </xsl:otherwise>   </xsl:choose> </xsl:template> </xsl:stylesheet>