xsl-list
[Top] [All Lists]

Re: wordml to docbook (sect1-sect5)

2005-12-06 20:58:58
Silvia,

Bob Stayton and I have already written a set of XSL stylesheets for doing the conversion of WordML to DocBook, as well as the reverse DocBook-to-WordML. These stylesheets may be found in the DocBook SourceForge project - http://docbook.sf.net/.

Unfortunately, they are not in the public distribution yet, but will be in the next release. For the moment, you can get the files from the CVS repository or you can grab the snapshot build from http:// docbook.sourceforge.net/snapshots/

HTHs,
Steve Ball

---

Steve Ball            |   XSLT Standard Library   | Training & Seminars
Explain         |     Web Tcl Complete      |   XML XSL Schemas
http://www.explain.com.au/ | TclXML TclDOM | Tcl, Web Development Steve(_dot_)Ball(_at_)explain(_dot_)com(_dot_)au +--------------------------- +---------------------
Ph. +61 2 6242 4099   |   Mobile (0413) 594 462   | Fax +61 2 6242 4099


On 06/12/2005, at 7:15 PM, Silvia Liberto wrote:

Hello!

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>

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

--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>