docbook-apps

  • 1.  Re: [docbook-apps] line breaks in

    Posted 06-28-2009 18:35
    Hi Sam,
    I don't think using normalize-space() would be satisfactory, because that
    function returns text only, and would remove the html markup that makes it a
    cross reference. Applying normalize-space to the xref would return
    nothing, because an xref element is empty.

    You don't want to mess with the markup, only with the text nodes of cross
    reference targets that contain carriage returns. There is no specific mode
    for that, but the no.anchor.mode comes close. It is used when generating
    cross references because it prevents nested links (i.e., no link anchors
    inside the link text). Since that is a mode, you can use it to match only
    the text nodes in titles as follows to map any line feeds in the title to
    spaces:

    <xsl:template match="title/text()" mode="no.anchor.mode">
    <xsl:value-of select="translate(., ' ', ' ')"/>
    </xsl:template>

    This seems to work, and I haven't noticed any side effects, but be sure to
    test it.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net





  • 2.  Re: [docbook-apps] line breaks in

    Posted 06-30-2009 19:14
    Hi Bob,

    On Sun, Jun 28, 2009 at 2:35 PM, Bob Stayton<bobs@sagehill.net> wrote:
    >
    > <xsl:template match="title/text()" mode="no.anchor.mode">
    > <xsl:value-of select="translate(., ' ', ' ')"/>
    > </xsl:template>

    Thanks a lot! Indeed, this is a huge improvement, see:
    http://clisp.podval.org/impnotes/mt.html#mt-unsafe
    however, programlisting/lineannot is a fixed width environment,
    i.e., each extra space is seen on the screen, observe
    the spaces between "other" and "mutable" in:
    “Hash Tables, Sequences, and other mutable objects”

    Cannot expect perfection :-)

    --
    Sam Steingold <http://sds.podval.org>