docbook-apps

  • 1.  Saxon linenumbering extension in programlisting

    Posted 12-14-2010 19:57
    I'm running into something that might or might not be considered a bug
    in the way the Saxon linenumbering extension works.

    Here's the setup:

    - I'm using Saxon and the latest stylesheets
    - The parameters are set up for line numbering
    (linenumbering.everyNth="1", use.extensions="1", and
    linenumbering.extension="1")
    - I'm using the following markup for a programlisting:

    <programlisting linenumbering="numbered"><xi:include href="file"
    parse="text"/></programlisting>

    When I do this, I get a numbered empty line after the last line in the
    file. I don't get this if I directly insert the content inline:

    <programlisting linenumbering="numbered">Line one
    Line two</programlisting>

    If I remove the final newline in the inserted file, this doesn't happen,
    so it's pretty clear the extension considers that last newline to
    indicate a new line to be numbered. The same thing happens if you put a
    newline before the closing </programlisting> in the second xml example
    above.

    So, the question is, should the extension treat a final newline this
    way?

    I'm inclined to think that it should not do this. It's not a big deal if
    your content is inline, but with xi:include, it means you need to
    manipulate your file to remove the newline character, which I suspect
    can cause problems if you're trying to use that content elsewhere (for
    example, to test a function).

    Any thoughts?

    Best Regards,
    Dick Hamilton
    ---------------------------------
    XML Press
    XML for Technical Communicators
    http://xmlpress.net
    (970) 231-3624





  • 2.  Re: [docbook-apps] Saxon linenumbering extension in programlisting

    Posted 12-15-2010 08:28
    Dick Hamilton wrote:

    > So, the question is, should the extension treat a final newline this
    > way?
    >
    > I'm inclined to think that it should not do this. It's not a big deal if
    > your content is inline, but with xi:include, it means you need to
    > manipulate your file to remove the newline character, which I suspect
    > can cause problems if you're trying to use that content elsewhere (for
    > example, to test a function).

    It's definitively bug and I think I have tried in past to find cause of
    problem -- but without success. But might be I'm just confusing this
    with somehow related bug in extensions:

    http://sourceforge.net/tracker/?func=detail&aid=3011108&group_id=21935&atid=373747

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    ------------------------------------------------------------------




  • 3.  RE: [docbook-apps] Saxon linenumbering extension in programlisting

    Posted 12-17-2010 18:30
    | -----Original Message-----
    | From: Dick Hamilton
    |
    | So, the question is, should the extension treat a final newline this
    | way?
    |
    | I'm inclined to think that it should not do this. It's not a
    | big deal if
    | your content is inline, but with xi:include, it means you need to
    | manipulate your file to remove the newline character, which I suspect
    | can cause problems if you're trying to use that content
    | elsewhere (for example, to test a function).
    |
    | Any thoughts?


    Try Bob's whitespace-trimming customization:
    http://lists.oasis-open.org/archives/docbook-apps/201011/msg00012.html

    Mauritz