XHTMLforum

XHTMLforum (http://xhtmlforum.de/index.php)
-   (X)HTML (http://xhtmlforum.de/forumdisplay.php?f=72)
-   -   Xml, Fo, Xsl (http://xhtmlforum.de/showthread.php?t=40520)

klopfdreh 28.06.2006 15:04

Xml, Fo, Xsl
 
Hallo zusammen,

ich habe ein kleines Problem beim Verständnis der XPath angabe innerhalb der später folgenden XSL Datei.

Code:

<?xml version='1.0'?>
<notesdoc>
<headline>Ich geh gern einkaufen und freue mich das ich gut kacken kann.</headline>
<richbody>
<pardef id='8' leftmargin='1in'><code event='hidewhen'><formula>(@TextToNumber(btc)&lt;1) | (btl[1]!="RTF") | !(ao0 ="edit")</formula></code></pardef>
<par def='8'>Das hier ist das Feld für den Shortext!</par>
</richbody>
<richbody>
<pardef id='9' leftmargin='1in'><code event='hidewhen'><formula>(@TextToNumber(btc)&lt;2) | (btl[2]!="RTF")  | !(ao1 ="edit")</formula></code></pardef>
<par def='9'>Hier steht Contents and scope drin.</par>
</richbody>
<richbody>
<pardef id='10' leftmargin='1in'><code event='hidewhen'><formula>(@TextToNumber(btc)&lt;3) | (btl[3]!="RTF")  | !(ao2 ="edit")</formula></code></pardef>
<par def='10'>Alles über die Lizens gibt es hier zu lesen.</par>
</richbody>
<richbody>
<pardef id='11' leftmargin='1in'><code event='hidewhen'><formula>(@TextToNumber(btc)&lt;4) | (btl[4]!="RTF") | !ao3 ="edit"</formula></code></pardef>
<par def='11'>Die Technische Realisation ist ein wichtiger teil der Help Pages!</par>
</richbody>
<richbody>
<pardef id='12' leftmargin='1in'><code event='hidewhen'><formula>(@TextToNumber(btc)&lt;5) | (btl[5]!="RTF") | !(ao4 ="edit")</formula></code></pardef>
<par def='12'>Hier stehen die Anforderungen für den Zugang.</par>
</richbody>
</notesdoc>

aus dieser XML datei muss ich mit Hilfe von FO alle Tabellen innerhalb eines Elementes formatieren. Wenn z.B. in dem richbody ein Element Table heißt muss es mit FO so formatiert werden, dass es in einer PDF auch dementsprechend gerendert wird. Wenn eine Tabelle in einer Tabelle liegt, diese natürlich ebenfalls.

Code:

<?xml version="1.0" encoding="utf-8"?>
<!-- Interpretation des Richtextes -->
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template match="/">
            <fo:root>
                <fo:layout-master-set>
                    <fo:simple-page-master margin="10mm 10mm 10mm 10mm" page-height="297mm"
                        page-width="210mm" master-name="A4Page">
                        <fo:region-before background-image="url('c:\\docxml\\1.gif')"
                                background-repeat="no-repeat" extent="20mm" />
                            <fo:region-body margin-top="22mm" margin-left="10mm"/>
                    </fo:simple-page-master>
                </fo:layout-master-set>
                <fo:page-sequence master-reference="A4Page">
                        <fo:flow flow-name="xsl-region-body">
                                <fo:block>
                                        <xsl:value-of select="headline" />
                                </fo:block>
                                <fo:block>       
                                        <xsl:apply-templates/>                                       
                                </fo:block>
                        </fo:flow>
                </fo:page-sequence>
            </fo:root>
        </xsl:template>
       
        <xsl:template match="/richbody/par">
                <xsl:value-of select="."/>
        </xsl:template>
       
        <!--<xsl:template match="table">
               
        </xsl:template>-->
</xsl:stylesheet>

Das ist die XSL Datei in der ich mit FO ein Layout-Master-Set angelegt hab um die Seite auf Din-A4 zu formatieren. Bei region before hab ich ein hintergrundbild eingefügt und im body sollen jetzt alle informationen aus
der XML datei bezogen werden.

Der Code oben kann sehr wüste aussehen, da er von dem DxlExporter
aus Lotus Notes mit Java generiert wurde.


Danke im Vorraus schonmal für die Hilfe und Viele Grüße :)


Alle Zeitangaben in WEZ +2. Es ist jetzt 16:47 Uhr.

Powered by vBulletin® Version 3.8.11 (Deutsch)
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

© Dirk H. 2003 - 2023