docbook-apps

  • 1.  Whitespace handling in "para" elements

    Posted 02-04-2013 19:44
    Hi,

    I have used DocBook several times for Technical Documentation with the
    "dblatex" workflow, what really produced a nice output with less work
    than creating it with LaTeX directly. :-)

    But now I'm forced to produce some MS Word output. The "roundtrip" is
    already a good starting point, but contains some bugs, that I try to fix
    on the way to my desired documents.

    My today's question is the desired whitespace handling inside the "para"
    element.

    How are spaces ( ), newlines ( ), carriage returns ( ) in
    the "para" element handled in other output formats?

    The current roundtrip preserves all the whitespaces except the first
    "newline".

    The first "newline" is dropped, all following are converted into "soft
    breaks".

    "carriage returns" are all preserved!

    What is the reason for this behaviour?

    The only hint I could find in TDG was the chapter about "Line-specific
    block elements". [1] This chapter would suggest to normalize all spaces
    in "para" elements.

    So, what to do?

    I would be very glad about any comments.

    [1] http://www.docbook.org/tdg51/en/html/ch02.html#s.line-specific

    Kind regards...
    Susanne



  • 2.  Re: [docbook-apps] Whitespace handling in "para" elements

    Posted 02-14-2013 00:11
    Hi Susanne,
    It seems this posting did not get a response. I'm pretty sure the handling
    of whitespace that you are seeing is unique to the roundtrip XSL stylesheet.
    For FO and HTML outputs, whitespace in para is just copied through to the
    output, with the expectation that the FO processor or HTML browser will
    handle it. That does not appear to be the case for MS Word, which requires
    special handling of the whitespace.

    I think this means you should be able to find the source of the problems in
    the roundtrip stylesheet, but I'm afraid I don't know much about that
    stylesheet to advise you.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net

    --------------------------------------------------
    From: "Susanne Wunsch" <docbook-apps@uriah.heep.sax.de>
    Sent: Monday, February 04, 2013 11:44 AM
    To: <docbook-apps@lists.oasis-open.org>
    Subject: [docbook-apps] Whitespace handling in "para" elements

    > Hi,
    >
    > I have used DocBook several times for Technical Documentation with the
    > "dblatex" workflow, what really produced a nice output with less work
    > than creating it with LaTeX directly. :-)
    >
    > But now I'm forced to produce some MS Word output. The "roundtrip" is
    > already a good starting point, but contains some bugs, that I try to fix
    > on the way to my desired documents.
    >
    > My today's question is the desired whitespace handling inside the "para"
    > element.
    >
    > How are spaces ( ), newlines ( ), carriage returns ( ) in
    > the "para" element handled in other output formats?
    >
    > The current roundtrip preserves all the whitespaces except the first
    > "newline".
    >
    > The first "newline" is dropped, all following are converted into "soft
    > breaks".
    >
    > "carriage returns" are all preserved!
    >
    > What is the reason for this behaviour?
    >
    > The only hint I could find in TDG was the chapter about "Line-specific
    > block elements". [1] This chapter would suggest to normalize all spaces
    > in "para" elements.
    >
    > So, what to do?
    >
    > I would be very glad about any comments.
    >
    > [1] http://www.docbook.org/tdg51/en/html/ch02.html#s.line-specific
    >
    > Kind regards...
    > Susanne
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >
    >
    >