User: mkirchner
Date: 05/02/16 06:15:23

Added:
 /de/documentation/faq/
  FAQ-xml-to-html_css.xsl

Log:
 FAQ xml to html css
 wandelt die Mitarbeiter FAQ und verwandte Dokumente in xhtml um
 Formatierung, die nicht Standard sind, werden orange markiert
 und sollten entfernt werden.

File Changes:

Directory: /de/documentation/faq/
=================================

File [added]: FAQ-xml-to-html_css.xsl
Url: 
http://de.openoffice.org/source/browse/de/documentation/faq/FAQ-xml-to-html_css.xsl?rev=1.1&content-type=text/vnd.viewcvs-markup
Added lines: 281
----------------
<!-- FAQ xml to html css                                                        
    -->
<!-- wandelt die Mitarbeiter FAQ und verwandte Dokumente in xhtml um            
    -->
<!-- Formatierung, die nicht Standard sind, werden orange markiert              
    -->
<!-- und sollten entfernt werden.                                               
    -->
<!--                                                                            
    -->
<!-- Author: Christian Lohmaier [EMAIL PROTECTED]                               
 -->
<!-- Lizenz: LGPL/SISSL                                                         
    -->
<!-- Datum/Version: 16.2.2005                                                   
    -->
<!-- teilweise UTF8 zeichen entfernt                                            
    -->
<!--                                                                            
    -->
<!-- vim: set ts=2: -->
<!-- Liste der namespace-Definitionen. geborgt von
        http://books.evc-cit.info/apc.html#xslt-framework-section -->
<xsl:transform version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
        xmlns:accel="http://openoffice.org/2001/accel"; 
        xmlns:chart="http://openoffice.org/2000/chart"; 
        xmlns:config="http://openoffice.org/2001/config"; 
        xmlns:dc="http://purl.org/dc/elements/1.1/"; 
        xmlns:dlg="http://openoffice.org/2000/dialog"; 
        xmlns:dr3d="http://openoffice.org/2000/dr3d"; 
        xmlns:draw="http://openoffice.org/2000/drawing"; 
        xmlns:event="http://openoffice.org/2001/event"; 
        xmlns:fo="http://www.w3.org/1999/XSL/Format"; 
        xmlns:form="http://openoffice.org/2000/form"; 
        xmlns:image="http://openoffice.org/2001/image"; 
        xmlns:library="http://openoffice.org/2000/library"; 
        xmlns:manifest="http://openoffice.org/2001/manifest"; 
        xmlns:math="http://www.w3.org/1998/Math/MathML";
        xmlns:menu="http://openoffice.org/2001/menu"; 
        xmlns:meta="http://openoffice.org/2000/meta"; 
        xmlns:number="http://openoffice.org/2000/datastyle"; 
        xmlns:office="http://openoffice.org/2000/office"; 
        xmlns:script="http://openoffice.org/2000/script"; 
        xmlns:statusbar="http://openoffice.org/2001/statusbar"; 
        xmlns:style="http://openoffice.org/2000/style"; 
        xmlns:svg="http://www.w3.org/2000/svg"; 
        xmlns:table="http://openoffice.org/2000/table"; 
        xmlns:text="http://openoffice.org/2000/text"; 
        xmlns:toolbar="http://openoffice.org/2001/toolbar"; 
        xmlns:xlink="http://www.w3.org/1999/xlink";
        exclude-result-prefixes="#default toolbar office statusbar menu 
manifest library image event dlg accel xlink text table svg style script number 
meta math form fo draw dr3d dc chart config" >
        
<!-- wir wollen xml, UTF-8,...-->
<xsl:output method = "xml"
        encoding = "UTF-8"
        omit-xml-declaration = "yes"
        indent = "yes"/>

<!-- Die Ober-Elemente eines OOo-Dokuments -->
<xsl:template match="office:document">
        <xsl:apply-templates/>
</xsl:template>
<xsl:template match="office:body">
        <xsl:apply-templates/>
</xsl:template>

<!-- mehrere Leerzeichen ignorieren -->
<xsl:template match="text:s"/>

<!-- Tab durch Leerezichen ersetzen -->
<xsl:template match="text:tab-stop">
        <xsl:text> </xsl:text>
</xsl:template>

<!-- styles und config Elemente, scripte interessieren nicht -->
<xsl:template match="office:styles|
        office:automatic-styles|
        office:settings|
        office:script|
        office:meta|
        office:master-styles|
        office:font-decls|
        text:table-of-content|
        text:sequence-decls|
        text:title|
        text:subject|
        text:line-break"/>

<xsl:template match="/">
<!-- Das HTML-Drumherum -->
<xsl:text disable-output-escaping = "yes">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD 
HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";>
</xsl:text>
<html>
<head>
<xsl:comment>Start de-header</xsl:comment>
<title><xsl:value-of select="//text:title"/></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<xsl:comment> Start Navbar </xsl:comment>
<!-- Navbar hier reinkopieren -->
<xsl:comment> End Navbar </xsl:comment>
<!-- Titel -->
<h1><xsl:value-of select="//text:title"/></h1>
<!-- Untertitel -->
<p><xsl:value-of select="//text:subject"/></p>
<h2>Inhaltsverzeichnis</h2>

<!-- Basteln eines Inhaltsverzeichnisses - alternative Version -->
<xsl:for-each select="//text:h">
        <xsl:variable name="pos_cur"><xsl:number level="any" 
count="//text:[EMAIL PROTECTED]:level = 1]"/></xsl:variable>
        <xsl:choose>
                <!-- Erste Ebene -->
                <xsl:when test="@text:level = 1">
                        <p><a href="#{generate-id()}"><xsl:number level="any" 
count="//text:[EMAIL PROTECTED]:level = 1]" format="1 "/>
                        <xsl:apply-templates/></a></p>
                </xsl:when>
        
                <!-- Zweite Ebene -->
                <xsl:when test="@text:level = 2">
                        <p><a href="#{generate-id()}">
                        <xsl:number value="count(preceding::text:[EMAIL 
PROTECTED]:level = 1])"/>-<xsl:number level="any" count="//text:[EMAIL 
PROTECTED]:level = 2]" from="//text:[EMAIL PROTECTED]:level = 1][$pos_cur]" 
format="1 "/>
                        <xsl:apply-templates/></a></p>
                </xsl:when>

                <!-- Dritte Ebene -->
                <xsl:when test="@text:level = 3">
                        <p><a href="#{generate-id()}">
                        <xsl:number value="count(preceding::text:[EMAIL 
PROTECTED]:level = 1])" format="1-"/>
                        <xsl:number level="any" count="//text:[EMAIL 
PROTECTED]:level = 2]" from="//text:[EMAIL PROTECTED]:level = 1][$pos_cur]" 
format="1-"/>
                        <xsl:number level="any" count="//text:[EMAIL 
PROTECTED]:level = 3]" from="//text:[EMAIL PROTECTED]:level = 2][$pos_cur]" 
format="1 "/>
                        <xsl:apply-templates/></a></p>
                </xsl:when>
        </xsl:choose>
</xsl:for-each>

<!-- Weiteren Inhalt einfügen -->
<xsl:apply-templates/>
</body>
</html>
</xsl:template>

<!-- Überschriften -->
<xsl:template match="text:h">
        <xsl:choose>
                <xsl:when test='@text:level = 1'>
                        <h1><xsl:number level="any" count="//text:[EMAIL 
PROTECTED]:level = 1]" format="1 "/><a 
name="{generate-id()}"><xsl:apply-templates/></a></h1>
                </xsl:when>

                <xsl:when test="@text:level = 2">
                        <h2><xsl:number level="any" count="//text:[EMAIL 
PROTECTED]:level = 1]" format="1-"/>
                        <xsl:number level="any" from="//text:[EMAIL 
PROTECTED]:level = 1]" count="//text:[EMAIL PROTECTED]:level = 2]" format="1 
"/><a name="{generate-id()}"><xsl:apply-templates/></a></h2>
                </xsl:when>

                <xsl:when test="@text:level = 3">
                        <h3><xsl:number level="any" count="//text:[EMAIL 
PROTECTED]:level = 1]" format="1-"/>
                        <xsl:number level="any" from="//text:[EMAIL 
PROTECTED]:level = 1]" count="//text:[EMAIL PROTECTED]:level = 2]" format="1-"/>
                        <xsl:number level="any" from="//text:[EMAIL 
PROTECTED]:level = 2]" count="//text:[EMAIL PROTECTED]:level = 3]" format="1 
"/><a name="{generate-id()}"><xsl:apply-templates/></a></h3>
                </xsl:when>
                
                <xsl:otherwise>
                        <p><font color="yellow" title="Überschriftenebene 
[EMAIL PROTECTED] nicht im XSLT"><xsl:apply-templates/></font></p>
                </xsl:otherwise>
        </xsl:choose>
</xsl:template>

<!-- Absatzvorlagen -->
<xsl:template match="text:p">
        <xsl:choose>
                <!-- Titel und Subtitel werden schon oben ausgelesen -->
                <xsl:when test='@text:style-name = "Subtitle"'/>
                <xsl:when test='@text:style-name = "Title"'/>
                
                <!-- Textkörper -->
                <xsl:when test='@text:style-name = "Text body"'>
                        <p><xsl:apply-templates/></p>
                </xsl:when>
                
                <!-- Textkörper Einrückung -->
                <xsl:when test='@text:style-name = "Text body indent"'>
                        <p><xsl:apply-templates/></p>
                </xsl:when>
                                
                <!-- Textkörper Einzug negativ -->
                <xsl:when test='@text:style-name = "Hanging indent"'>
                        <p><xsl:apply-templates/></p>
                </xsl:when>
        
                <!-- Aufzählung 1 Anfang -->
                <xsl:when test='@text:style-name = "List 1 Start"'>
                <p><xsl:apply-templates/></p>
                </xsl:when>
                
                <!-- Aufzählung 1 Fortsetzung -->
                <xsl:when test='@text:style-name = "List 1 Cont."'>
                        <p><xsl:apply-templates/></p>
                </xsl:when>
                
                <!-- selbst erstellte Vorlagen -->
                <xsl:when test='@text:style-name = "Lizenz Überschrift"'>
                        <p><small><em><xsl:apply-templates/></em></small></p>
                </xsl:when>
                <xsl:when test='@text:style-name = "Lizenz"'>
                        <p><small><xsl:apply-templates/></small></p>
                </xsl:when>
                <xsl:when test='@text:style-name = "Textkörper Nummer"'>
                        <xsl:apply-templates/>
                </xsl:when>
                
                <xsl:otherwise>
                        <p><font color="red" title="harte Formatierung oder 
Absatzvorlage [EMAIL PROTECTED] nicht im XSLT"><xsl:apply-templates/></font></p>
                </xsl:otherwise>
        </xsl:choose>
</xsl:template>

<!-- Zeichenvorlagen -->
<xsl:template match="text:span">
        <xsl:choose>
                <!-- betont -->
                <xsl:when test='@text:style-name = "Emphasis"'>
                        <em><xsl:apply-templates/></em>
                </xsl:when>
                
                <!-- stark betont -->
                <xsl:when test='@text:style-name = "Strong Emphasis"'>
                        <strong><xsl:apply-templates/></strong>
                </xsl:when>

                <!-- Internet Link -->
                <xsl:when test='@text:style-name = "Internet link"'>
                        <!-- tue nichts - wird durch das x-ref teil bearbeitet 
-->
                        <xsl:apply-templates/>
                </xsl:when>
                
                <!-- selbst erstellte Vorlagen -->
                <xsl:when test='@text:style-name = "englisch"'>
                        <!-- tue nichts - Sprache des Textes ist bedeutungslos 
-->
                        <xsl:apply-templates/>
                </xsl:when>
                <xsl:when test='@text:style-name = "englisch_kursiv"'>
                        <!-- ersetze kursiv durch <em> -->
                        <em><xsl:apply-templates/></em>
                </xsl:when>
                <xsl:when test='@text:style-name = "kursiv"'>
                        <!-- ersetze kursiv durch <em> -->
                        <em><xsl:apply-templates/></em>
                </xsl:when>
                
                <xsl:otherwise>
                         <font color="orange">*<abbr title="Harte Formatierung! 
(oder Zeichenvorlage [EMAIL PROTECTED] nicht im 
XSLT)"><xsl:apply-templates/></abbr>*</font>
                </xsl:otherwise>
        </xsl:choose>
</xsl:template>

<!-- Aufzählungen - Teil 1 -->
<xsl:template match="text:unordered-list">
        <ul><xsl:apply-templates/></ul>
</xsl:template>

<!-- Aufzählungen - Teil 2 -->
<xsl:template match="text:list-item">
                                <li><xsl:apply-templates/></li>
</xsl:template>

<!-- Hyperlinks -->
<xsl:template match="text:a">
        <xsl:variable name="linkziel"><xsl:value-of 
select="@xlink:href"/></xsl:variable>
        <a href='{$linkziel}'><xsl:apply-templates/></a>
</xsl:template>

<!-- Verkinke Grafiken -->
<xsl:template match="draw:image">
        <xsl:variable name="bildziel"><xsl:value-of 
select="@xlink:href"/></xsl:variable>
        <xsl:variable name="bildname"><xsl:value-of 
select="@draw:name"/></xsl:variable>
        <img src='{$bildziel}' name='{$bildname}'/>
</xsl:template>

<!-- Querverweis Link -->
<xsl:template match="text:reference-ref">
        <xsl:variable name="refname"><xsl:value-of 
select="@text:ref-name"/></xsl:variable>
        <a href='#{$refname}'><xsl:apply-templates/></a>
</xsl:template>

<!-- Querverweis Sprungziel -->
<xsl:template match="text:reference-mark">
        <xsl:variable name="anchorname"><xsl:value-of 
select="@text:name"/></xsl:variable>
        <a name='{$anchorname}'><xsl:apply-templates/></a>
</xsl:template>

</xsl:transform>




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Antwort per Email an