xsl-list
[Top] [All Lists]

wordml to docbook (sect1-sect5) with xmlfile

2005-12-06 02:32:36
Hello!

sorry in my last message i forgot the xmlfile!

I want to transform a wordml document into a docbookXML document!
i use xsl 1.0. At the moment I have the problem to create sections like
sect1 to sect5!

I want to make a construction like this:

<sect1>

      <title>title one with the style: ueberschrift1</title>

      <para>text etc.</para>

      <table>

      ?

      </table>

      <sect2>

            <title> second title with the style: ueberschrift2</title>

            <para> text etc. </para>

            <itemizedlist>

            ?

            </itemizedlist>

            <sect3>

<title>third title with the style: ueberschrift3</title>

<para> text etc. </para>

                  <itemizedlist>

                  ?

                  </itemizedlist>

            </sect3>

      </sect2>

</sect1>

<sect1>

<title>another title with style: ueberschrift1</title>

      <para>text etc.</para>

      <table>

      ?

      </table>

</sect1>

and this is my xml file:
...
<w:body>
                <wx:sect>
                        <w:p>
                                <w:pPr>
                                        <w:pStyle w:val="Ueberschrift1"/>
                                        <w:rPr>
                                                <w:lang w:val="DE"/>
                                        </w:rPr>
                                </w:pPr>
                                <w:r>
                                        <w:rPr>
                                                <w:lang w:val="DE"/>
                                        </w:rPr>
                                        <w:t>HTML Server-Steuerelemente</w:t>
                                </w:r>
                        </w:p>
                        <w:p>
                                <w:pPr>
                                        <w:pStyle w:val="Ueberschrift2"/>
                                </w:pPr>
                                <w:r>
                                        <w:t>Grundlagen</w:t>
                                </w:r>
                        </w:p>
                        <w:p>
                                <w:pPr>
                                        <w:jc w:val="left"/>
                                </w:pPr>
                                <w:r>
                                        <w:t>HTML-Steuerelemente entsprechen 
programmierbaren HTML-Tags. Sie
entstehen dadurch, dass ein HTML-Tag durch die Attribute id und
runat="server" hinzugefügt werden. Alle so gekennzeichneten Tags werden
</w:t>
                                </w:r>
                                <w:r>
                                        <w:rPr>
                                                <w:b/>
                                        </w:rPr>
                                        <w:t>Teil des Objekts</w:t>
                                </w:r>
                                <w:r>
                                        <w:t> Page bzw. Teil von 
untergeordneten Steuerelementen. Je nach Typ
werden verschiedene Eigenschaften und Methoden zur Verfügung gestellt.
</w:t>
                                </w:r>
                                <w:r>
                                        <w:rPr>
                                                <w:b/>
                                        </w:rPr>
                                        <w:t>Attribute</w:t>
                                </w:r>
                                <w:r>
                                        <w:t> und Inhalte lassen sich so 
programmieren. Die HTML-Steuerelemente
werden im Namensraum System.Web.UI.HtmlControls definiert (UI steht für User
Interface). Eine Unterklasse bilden die Container- </w:t>
                                </w:r>
                                <w:r>
                                        <w:rPr>
                                                <w:rFonts w:ascii="Courier New" 
w:h-ansi="Courier New"/>
                                                <wx:font wx:val="Courier New"/>
                                                <w:sz w:val="22"/>
                                        </w:rPr>
                                        <w:t>InnerText</w:t>
                                </w:r>
                                <w:r>
                                        <w:t>, bzw. </w:t>
                                </w:r>
                                <w:r>
                                        <w:rPr>
                                                <w:rFonts w:ascii="Courier New" 
w:h-ansi="Courier New"/>
                                                <wx:font wx:val="Courier New"/>
                                                <w:sz w:val="22"/>
                                        </w:rPr>
                                        <w:t>Text</w:t>
                                </w:r>
                                <w:r>
                                        <w:t> kontrolliert werden. </w:t>
                                </w:r>
                        </w:p>
                        <w:p/>
                        <w:p>
                                <w:pPr>
                                        <w:pStyle w:val="Ueberschrift3"/>
                                </w:pPr>
                                <w:r>
                                        <w:t>Basisoperationen mit 
Steuerelementen</w:t>
                                </w:r>
                        </w:p>
                        <w:p>
                                <w:pPr>
                                        <w:pStyle w:val="Ueberschrift2"/>
                                </w:pPr>
                        </w:p>
                        <w:p>
                                <w:pPr>
                                        <w:jc w:val="left"/>
                                </w:pPr>
                                <w:r>
                                        <w:t>Innerhalb einer </w:t>
                                </w:r>
                                <w:r>
                                        <w:rPr>
                                                <w:bdr w:val="single" w:sz="4" 
wx:bdrwidth="10" w:space="0"
w:color="auto"/>
                                        </w:rPr>
                                        <w:t>ASPX-Seite sind die 
Server-Steuerelemente</w:t>
                                </w:r>
                                <w:r>
                                        <w:t> in einer Hierarchie angeordnet. 
Diese Hierarchie kann
programmgesteuert verändert werden. Alle Steuerelemente einer Ebene sind in
Kollektionen vom Typ </w:t>
                                </w:r>
                                <w:r>
                                        <w:rPr>
                                                <w:rFonts w:ascii="Courier New" 
w:h-ansi="Courier New"/>
                                                <wx:font wx:val="Courier New"/>
                                                <w:sz w:val="22"/>
                                        </w:rPr>
                                        <w:t>ControlCollection</w:t>
                                </w:r>
                                <w:r>
                                        <w:t> enthalten. Über die Methoden 
</w:t>
                                </w:r>
                                <w:r>
                                        <w:rPr>
                                                <w:rFonts w:ascii="Courier New" 
w:h-ansi="Courier New"/>
                                                <wx:font wx:val="Courier New"/>
                                                <w:sz w:val="22"/>
                                        </w:rPr>
                                        <w:t>Add</w:t>
                                </w:r>
                                <w:r>
                                        <w:t>, </w:t>
                                </w:r>
                                <w:r>
                                        <w:rPr>
                                                <w:rFonts w:ascii="Courier New" 
w:h-ansi="Courier New"/>
                                                <wx:font wx:val="Courier New"/>
                                                <w:sz w:val="22"/>
                                        </w:rPr>
                                        <w:t>RemoveAt</w:t>
                                </w:r>
                                <w:r>
                                        <w:t> bzw. </w:t>
                                </w:r>
                                <w:r>
                                        <w:rPr>
                                                <w:rFonts w:ascii="Courier New" 
w:h-ansi="Courier New"/>
                                                <wx:font wx:val="Courier New"/>
                                                <w:sz w:val="22"/>
                                        </w:rPr>
                                        <w:t>Clear</w:t>
                                </w:r>
                                <w:r>
                                        <w:t> können Steuerelemente hinzugefügt 
bzw. entfernt werden. </w:t>
                                </w:r>
                                <w:r>
                                        <w:br/>
                                        <w:t>Im folgenden Beispiel wird ein 
meta-Tag dynamisch hinzugefügt,
welches alle  3 Sekunden ein automatisches Refreshing bewirkt.</w:t>
                                </w:r>
                                <w:r>
                                        <w:br/>
                                </w:r>
                                <w:r>
                                        <w:br/>
                                </w:r>
                                <w:r>
                                        <w:pict>
                                                <v:shapetype id="_x0000_t75" 
coordsize="21600,21600" o:spt="75"
o:preferrelative="t" path="m(_at_)4@5l(_at_)4@11(_at_)9@11(_at_)9@5xe" 
filled="f" stroked="f">
                                                        <v:stroke 
joinstyle="miter"/>
                                                        <v:formulas>
                                                                <v:f eqn="if 
lineDrawn pixelLineWidth 0"/>
                                                                <v:f eqn="sum 
@0 1 0"/>
                                                                <v:f eqn="sum 0 
0 @1"/>
                                                                <v:f eqn="prod 
@2 1 2"/>
                                                                <v:f eqn="prod 
@3 21600 pixelWidth"/>
                                                                <v:f eqn="prod 
@3 21600 pixelHeight"/>
                                                                <v:f eqn="sum 
@0 0 1"/>
                                                                <v:f eqn="prod 
@6 1 2"/>
                                                                <v:f eqn="prod 
@7 21600 pixelWidth"/>
                                                                <v:f eqn="sum 
@8 21600 0"/>
                                                                <v:f eqn="prod 
@7 21600 pixelHeight"/>
                                                                <v:f eqn="sum 
@10 21600 0"/>
                                                        </v:formulas>
                                                        <v:path 
o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
                                                        <o:lock v:ext="edit" 
aspectratio="t"/>
                                                </v:shapetype>
                                                <v:shape id="_x0000_i1025" 
type="#_x0000_t75"
style="width:189pt;height:141.75pt">
                                                        <v:imagedata 
src="C:\Documents and Settings\All Users\Documents\My
Pictures\Sample Pictures\Winter.jpg"/>
                                                </v:shape>
                                        </w:pict>
                                </w:r>
                        </w:p>
                        <w:p/>
                        <w:p>
                                <w:r>
                                        <w:br w:type="page"/>
                                        <w:t>Hyperlinkdarstellung: mit der 
Seite von </w:t>
                                </w:r>
                                <w:hlink w:dest="http://www.ulm.de/";>
                                        <w:r>
                                                <w:rPr>
                                                        <w:rStyle 
w:val="Hyperlink"/>
                                                </w:rPr>
                                                <w:t>Ulm</w:t>
                                        </w:r>
                                </w:hlink>
                        </w:p>
                        <w:p/>
                        <w:p>
                                <w:r>
                                        <w:t>Eine Aufzählung würde noch gut 
reinpassen:</w:t>
                                </w:r>
                        </w:p>
                        <w:p>
                                <w:pPr>
                                        <w:listPr>
                                                <w:ilvl w:val="0"/>
                                                <w:ilfo w:val="1"/>
                                                <wx:t wx:val="·" 
wx:wTabBefore="360" wx:wTabAfter="240"/>
                                                <wx:font wx:val="Symbol"/>
                                        </w:listPr>
                                        <w:jc w:val="left"/>
                                </w:pPr>
                                <w:r>
                                        <w:t>Erster Aufzählungspunkt</w:t>
                                </w:r>
                        </w:p>
                        <w:p>
                                <w:pPr>
                                        <w:listPr>
                                                <w:ilvl w:val="1"/>
                                                <w:ilfo w:val="1"/>
                                                <wx:t wx:val="o" 
wx:wTabBefore="1080" wx:wTabAfter="210"/>
                                                <wx:font wx:val="Courier New"/>
                                        </w:listPr>
                                        <w:jc w:val="left"/>
                                </w:pPr>
                                <w:r>
                                        <w:t>Ein Unterpunkt</w:t>
                                </w:r>
                        </w:p>
                        <w:p>
                                <w:pPr>
                                        <w:listPr>
                                                <w:ilvl w:val="1"/>
                                                <w:ilfo w:val="1"/>
                                                <wx:t wx:val="o" 
wx:wTabBefore="1080" wx:wTabAfter="210"/>
                                                <wx:font wx:val="Courier New"/>
                                        </w:listPr>
                                        <w:jc w:val="left"/>
                                </w:pPr>
                                <w:r>
                                        <w:t>Ein weiterer Unterpunkt</w:t>
                                </w:r>
                        </w:p>
                        <w:p>
                                <w:pPr>
                                        <w:listPr>
                                                <w:ilvl w:val="2"/>
                                                <w:ilfo w:val="1"/>
                                                <wx:t wx:val="§" 
wx:wTabBefore="1800" wx:wTabAfter="255"/>
                                                <wx:font wx:val="Wingdings"/>
                                        </w:listPr>
                                        <w:jc w:val="left"/>
                                </w:pPr>
                                <w:r>
                                        <w:t>3. Ebene</w:t>
                                </w:r>
                        </w:p>
                        <w:p>
                                <w:pPr>
                                        <w:listPr>
                                                <w:ilvl w:val="0"/>
                                                <w:ilfo w:val="1"/>
                                                <wx:t wx:val="·" 
wx:wTabBefore="360" wx:wTabAfter="240"/>
                                                <wx:font wx:val="Symbol"/>
                                        </w:listPr>
                                        <w:jc w:val="left"/>
                                </w:pPr>
                                <w:r>
                                        <w:t>Zweiter Aufzählungspunkt</w:t>
                                </w:r>
                        </w:p>
                        <w:p>
                                <w:pPr>
                                        <w:listPr>
                                                <w:ilvl w:val="0"/>
                                                <w:ilfo w:val="1"/>
                                                <wx:t wx:val="·" 
wx:wTabBefore="360" wx:wTabAfter="240"/>
                                                <wx:font wx:val="Symbol"/>
                                        </w:listPr>
                                        <w:jc w:val="left"/>
                                </w:pPr>
                                <w:r>
                                        <w:t>Dritter Aufzählungspunkt</w:t>
                                </w:r>
                        </w:p>
                        <w:p/>
                        <w:p/>
                        <w:sectPr>
                                <w:pgSz w:w="12240" w:h="15840"/>
                                <w:pgMar w:top="1440" w:right="1800" 
w:bottom="1440" w:left="1800"
w:header="708" w:footer="708" w:gutter="0"/>
                                <w:cols w:space="708"/>
                                <w:docGrid w:line-pitch="360"/>
                        </w:sectPr>
                </wx:sect>
        </w:body>


In my xml file I have styles for headings like ?ueberschrift1? till
?ueberschrift5?.

So my problem is, if for example the style ?ueberschrift1? is in my xml
document, I want to set the tag ?sect1? and the whole content between this
style and the next should be in this tag. When the next tag is coming for
example ?ueberschrift2? another tag->?sect2? should be opend inside the
sect1-tag?and when no tag is coming any more, first ?sect2? and then
?sect1? shoud be closed.


I have tried so many things and the last experiment was this:

At this position: XXX  i don´t know how to say that the next following
elements should be written down like itemizedlist etc. before closing
The <sect2> and <sect1>..tag!? Have someone an idea?

<xsl:template match="w:p" mode="sect-begin">

        <sect1>
                <title>
                      <xsl:value-of select="w:r/w:t"/>
                </title>   
                      <xsl:apply-templates select="." mode="next-sect">
                      <xsl:with-param name="level"
select="number(substring(w:pPr/w:pStyle/@w:val,13))"/>
                      </xsl:apply-templates>
        </sect1>
</xsl:template>

            

 <xsl:template match="w:p" mode="next-sect">

         <xsl:param name="level"/>
         <xsl:variable name="next_p"
select="following-sibling::w:p[node()][1]/w:pPr/w:pStyle/@w:val"/>
         <xsl:variable name="next_p_num"
select="number(substring($next_p,13))"/>
                 <xsl:if test="$next_p_num=$level+1">
                             <sect2>
                                  <title>
                                       <xsl:value-of
select="following-sibling::w:p[node()][1]/w:r/w:t"/>                        
                                   
                                  </title>                                 

                                                XXX            

                              </sect2>
                  </xsl:if> 


thanks very much!
kind regards
silvia

-- 
10 GB Mailbox, 100 FreeSMS/Monat http://www.gmx.net/de/go/topmail
+++ GMX - die erste Adresse für Mail, Message, More +++

-- 
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner

-- 
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner

-- 
Telefonieren Sie schon oder sparen Sie noch?
NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>