docbook-apps

  • 1.  wordml-* : missing whitespaces

    Posted 01-27-2007 07:31
    Hello there,

    I have been using xsltproc in conjunction with the wordml-*.xsl
    stylesheet to try to produce a docbook document but I have a couple of
    minor issues. Hopefully someone can tell me if I am doing something
    wrong.

    The original Word document contains:
    <w:pStyle w:val="TableEntry"/><w:keepNext/><w:keepLines/></w:pPr><w:r><w:t>Sex
    of the named patient. Enumerated
    Values:</w:t></w:r><w:r><w:br/></w:r><w:r><w:tab/><w:t>M =
    male</w:t></w:r><w:r><w:br/></w:r><w:r><w:tab/><w:t>F =
    female</w:t></w:r><w:r><w:br/></w:r><w:r><w:tab/><w:t>O =
    other</w:t></w:r>

    Output docbook file contains:
    <entry>Sex of the named patient. Enumerated Values:M = maleF = femaleO
    = other</entry>

    Is there anything I should do to keep those whitespaces ?

    Thanks !


    --
    Mathieu


    Steps used:
    xsltproc -o normalised.xml wordml-normalise.xsl my-word.xml
    xsltproc -o sections.xml wordml-sections.xsl normalised.xml
    xsltproc -o blocks.xml wordml-blocks.xsl sections.xml
    xsltproc -o my-docbook.xml wordml-final.xsl blocks.xml

    $ xsltproc --version
    Using libxml 20627, libxslt 10119 and libexslt 813
    xsltproc was compiled against libxml 20627, libxslt 10119 and libexslt 813
    libxslt 10119 was compiled against libxml 20627
    libexslt 813 was compiled against libxml 20627



  • 2.  Re: wordml-* : missing whitespaces

    Posted 01-27-2007 22:39
    On 1/27/07, Mathieu Malaterre <mathieu.malaterre@gmail.com> wrote:
    > Hello there,
    >
    > I have been using xsltproc in conjunction with the wordml-*.xsl
    > stylesheet to try to produce a docbook document but I have a couple of
    > minor issues. Hopefully someone can tell me if I am doing something
    > wrong.
    >
    > The original Word document contains:
    > <w:pStyle w:val="TableEntry"/><w:keepNext/><w:keepLines/></w:pPr><w:r><w:t>Sex
    > of the named patient. Enumerated
    > Values:</w:t></w:r><w:r><w:br/></w:r><w:r><w:tab/><w:t>M =
    > male</w:t></w:r><w:r><w:br/></w:r><w:r><w:tab/><w:t>F =
    > female</w:t></w:r><w:r><w:br/></w:r><w:r><w:tab/><w:t>O =
    > other</w:t></w:r>
    >
    > Output docbook file contains:
    > <entry>Sex of the named patient. Enumerated Values:M = maleF = femaleO
    > = other</entry>
    >
    > Is there anything I should do to keep those whitespaces ?

    Dave Pawson suggested the following solution:

    http://xml.openoffice.org/servlets/ReadMsg?list=dev&msgNo=2915

    ...
    Looks like you need to add

    <xsl:template match="text:line-break">
    <xsl:text> </xsl:text>
    </xsl:template>
    ...

    My guess is that roundtrip/wordml-* is also missing something like:

    <xsl:template match="w:br">
    <xsl:text> </xsl:text>
    </xsl:template>

    The only drawback to that solution is that it -sometime- add a final
    whitespace, but easily fixed with a normalize-space().

    -M



  • 3.  Re: [docbook-apps] Re: wordml-* : missing whitespaces

    Posted 01-28-2007 20:21
    Hi Mathieu,

    It would be good if you could submit a bug report on SourceForge so
    that I can track this issue.

    Please send me a complete sample Word document that demonstrates this
    problem. I'm currently working on a new set of conversion
    stylesheets and I will look at fixing this in that new work.

    Cheers,
    Steve Ball

    On 28/01/2007, at 9:39 AM, Mathieu Malaterre wrote:

    > On 1/27/07, Mathieu Malaterre <mathieu.malaterre@gmail.com> wrote:
    >> Hello there,
    >>
    >> I have been using xsltproc in conjunction with the wordml-*.xsl
    >> stylesheet to try to produce a docbook document but I have a
    >> couple of
    >> minor issues. Hopefully someone can tell me if I am doing something
    >> wrong.
    >>
    >> The original Word document contains:
    >> <w:pStyle w:val="TableEntry"/><w:keepNext/><w:keepLines/>>> w:pPr><w:r><w:t>Sex
    >> of the named patient. Enumerated
    >> Values:</w:t></w:r><w:r><w:br/></w:r><w:r><w:tab/><w:t>M =
    >> male</w:t></w:r><w:r><w:br/></w:r><w:r><w:tab/><w:t>F =
    >> female</w:t></w:r><w:r><w:br/></w:r><w:r><w:tab/><w:t>O =
    >> other</w:t></w:r>
    >>
    >> Output docbook file contains:
    >> <entry>Sex of the named patient. Enumerated Values:M = maleF =
    >> femaleO
    >> = other</entry>
    >>
    >> Is there anything I should do to keep those whitespaces ?
    >
    > Dave Pawson suggested the following solution:
    >
    > http://xml.openoffice.org/servlets/ReadMsg?list=dev&msgNo=2915
    >
    > ...
    > Looks like you need to add
    >
    > <xsl:template match="text:line-break">
    > <xsl:text> </xsl:text>
    > </xsl:template>
    > ...
    >
    > My guess is that roundtrip/wordml-* is also missing something like:
    >
    > <xsl:template match="w:br">
    > <xsl:text> </xsl:text>
    > </xsl:template>
    >
    > The only drawback to that solution is that it -sometime- add a final
    > whitespace, but easily fixed with a normalize-space().
    >
    > -M
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-
    > open.org
    >
    >




  • 4.  Re: [docbook-apps] Re: wordml-* : missing whitespaces

    Posted 01-28-2007 23:23
    Hi Steve,

    Done:
    [ 1646648 ] w:br are not replaced properly
    [ 1646657 ] w:tab not replaced correctly
    [ 1646663 ] w:sym character are lost

    I did not include the full word xml document because it's too big. But
    if you need it you can download it from (need to be converted to xml
    first):

    http://medical.nema.org/dicom/2007/07_03pu.doc

    Thanks !
    -Mathieu

    On 1/28/07, Steve Ball <Steve.Ball@explain.com.au> wrote:
    > Hi Mathieu,
    >
    > It would be good if you could submit a bug report on SourceForge so
    > that I can track this issue.
    >
    > Please send me a complete sample Word document that demonstrates this
    > problem. I'm currently working on a new set of conversion
    > stylesheets and I will look at fixing this in that new work.
    >
    > Cheers,
    > Steve Ball
    >
    > On 28/01/2007, at 9:39 AM, Mathieu Malaterre wrote:
    >
    > > On 1/27/07, Mathieu Malaterre <mathieu.malaterre@gmail.com> wrote:
    > >> Hello there,
    > >>
    > >> I have been using xsltproc in conjunction with the wordml-*.xsl
    > >> stylesheet to try to produce a docbook document but I have a
    > >> couple of
    > >> minor issues. Hopefully someone can tell me if I am doing something
    > >> wrong.
    > >>
    > >> The original Word document contains:
    > >> <w:pStyle w:val="TableEntry"/><w:keepNext/><w:keepLines/>> >> w:pPr><w:r><w:t>Sex
    > >> of the named patient. Enumerated
    > >> Values:</w:t></w:r><w:r><w:br/></w:r><w:r><w:tab/><w:t>M =
    > >> male</w:t></w:r><w:r><w:br/></w:r><w:r><w:tab/><w:t>F =
    > >> female</w:t></w:r><w:r><w:br/></w:r><w:r><w:tab/><w:t>O =
    > >> other</w:t></w:r>
    > >>
    > >> Output docbook file contains:
    > >> <entry>Sex of the named patient. Enumerated Values:M = maleF =
    > >> femaleO
    > >> = other</entry>
    > >>
    > >> Is there anything I should do to keep those whitespaces ?
    > >
    > > Dave Pawson suggested the following solution:
    > >
    > > http://xml.openoffice.org/servlets/ReadMsg?list=dev&msgNo=2915
    > >
    > > ...
    > > Looks like you need to add
    > >
    > > <xsl:template match="text:line-break">
    > > <xsl:text> </xsl:text>
    > > </xsl:template>
    > > ...
    > >
    > > My guess is that roundtrip/wordml-* is also missing something like:
    > >
    > > <xsl:template match="w:br">
    > > <xsl:text> </xsl:text>
    > > </xsl:template>
    > >
    > > The only drawback to that solution is that it -sometime- add a final
    > > whitespace, but easily fixed with a normalize-space().
    > >
    > > -M
    > >
    > > ---------------------------------------------------------------------
    > > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > > For additional commands, e-mail: docbook-apps-help@lists.oasis-
    > > open.org
    > >
    > >
    >
    >


    --
    Mathieu