[xep-support] Replace straight apostrophe with curly apostrophe

Kevin Brown kevin at renderx.com
Sun Jan 17 11:34:51 PST 2010


That was a test file ... of course, you could just remove the <text> ... as
in:

    <xsl:param name="singlequote">
        <xsl:text>'</xsl:text>
    </xsl:param>
    <xsl:param name="doublequote">
        <xsl:text>"</xsl:text>
    </xsl:param>
    <xsl:template match="text()">
        <xsl:value-of select="translate(.,$singlequote,$doublequote)"/>
    </xsl:template>

-----Original Message-----
From: owner-xep-support at renderx.com [mailto:owner-xep-support at renderx.com]
On Behalf Of Kevin Brown
Sent: Sunday, January 17, 2010 11:19 AM
To: xep-support at renderx.com
Subject: RE: [xep-support] Replace straight apostrophe with curly apostrophe

Paul:

If you are talking about changing all singles quotes in a string to double
quotes, here is one (of many) ways ...

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
    <xsl:param name="singlequote">
        <xsl:text>'</xsl:text>
    </xsl:param>
    <xsl:param name="doublequote">
        <xsl:text>"</xsl:text>
    </xsl:param>
    <xsl:template match="text()">
        <text>
            <xsl:value-of select="translate(.,$singlequote,$doublequote)"/>
        </text>
    </xsl:template>
</xsl:stylesheet>

Be careful though -- what about things like *don't do it*?

Kevin Brown
RenderX

-----Original Message-----
From: owner-xep-support at renderx.com [mailto:owner-xep-support at renderx.com]
On Behalf Of Harvey, Paul
Sent: Sunday, January 17, 2010 8:25 AM
To: xep-support at renderx.com
Subject: [xep-support] Replace straight apostrophe with curly apostrophe

Sounds like the simplest thing in the world, but I can figure this out.
Whatever I try I get errors along the lines of

Unmatched quote in expression '

The problem is - how to select a single apostrophe in XSLT?

Thanks


-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service
http://www.renderx.com/terms-of-service.html

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service
http://www.renderx.com/terms-of-service.html

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html



More information about the Xep-support mailing list