docbook-apps

  • 1.  Re: [docbook-apps] Replace straight apostrophe with curly apostrophe

    Posted 02-18-2010 18:40
    Hi,
    The difference with xref is that the content is processed in a different mode. Try
    adding this template to your customization layer:

    <xsl:template match="d:para/text()|d:title/text()" mode="no.anchor.mode">
    <xsl:value-of select="translate(.,$singlequote,$curlyquote)"/>
    </xsl:template>

    The 'no.anchor.mode' is used only for hot text, so that no nested links are created.

    Let me know if this does not work.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    ----- Original Message -----
    From: "Jacques Foucry" <jacques@foucry.net>
    To: "docbook-apps" <docbook-apps@lists.oasis-open.org>
    Sent: Thursday, February 18, 2010 8:36 AM
    Subject: [docbook-apps] Replace straight apostrophe with curly apostrophe


    Hello list,

    After a long discussion in XEP-support mailing list I still have a problem for
    replacing straight apostrophe with curly apostrophe.

    I my custom stylesheet I've put:

    <xsl:param name="singlequote">
    <xsl:text>'</xsl:text>
    </xsl:param>
    <xsl:param name="curlyquote">
    <xsl:text>’</xsl:text>
    </xsl:param>

    <xsl:template match="d:para//text()|d:title//text()">
    <xsl:value-of select="translate(.,$singlequote,$curlyquote)"/>
    </xsl:template>

    With this configuration all the straight apostrophe are changed into curly apostrophe.
    But it's ok for me. I would like to keep straight apostrophe for <litteral>,
    <computeroutput> or <screen> tags.

    During my tests I've change the stylesheet by (no more double slash):

    <xsl:template match="d:para/text()|d:title/text()">
    <xsl:value-of select="translate(.,$singlequote,$curlyquote)"/>
    </xsl:template>

    And it works well for text, title and screen (litteral and computer output too) but it
    failed on <xref>.

    In fact I could have in my text something like that:

    See <xref linkend="alice_home_dir">.



    ....


    I suppose that because the <xref linkend> reside before the title. But in fact the
    replacement is not made in the figure's title too.

    So for resuming how can I change the straight apostrophe into curly apostrophe every
    where except inside <computeroutput>, <litteral> and <screen> tags ?

    Thanks in advance,
    Jacques


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org






  • 2.  Re: [docbook-apps] Replace straight apostrophe with curly apostrophe

    Posted 02-19-2010 14:30
    On 18 févr. 2010, at 19:39, Bob Stayton wrote:
    Hi Bob,

    > <xsl:template match="d:para/text()|d:title/text()" mode="no.anchor.mode">
    > <xsl:value-of select="translate(.,$singlequote,$curlyquote)"/>
    > </xsl:template>
    >
    > The 'no.anchor.mode' is used only for hot text, so that no nested links are created.
    >
    > Let me know if this does not work.


    It work's fine for all the case I've check.

    Thanks for your help,

    Jacques