[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [docbook-apps] escaping characters in toc.hhc
I didn’t know about the extension
and -Dencoding.windows-1252=com.nwalsh.saxon.Windows1252 thing and had ended up
adding ndash, mdash, ldquo, rdquo, lsquo, and rsquo to my customization layer. Here’s
the template in case you want to punt like I did :-) David <xsl:template
name="escape-attr"> <xsl:param
name="value"/> <xsl:variable
name="quote.char">'</xsl:variable> <xsl:variable
name="amp.escaped"> <xsl:call-template
name="string.subst">
<xsl:with-param name="string" select="$value"/>
<xsl:with-param name="target" select="'&'"/>
<xsl:with-param name="replacement"
select="'&amp;'"/>
</xsl:call-template> </xsl:variable> <xsl:variable
name="quot.escaped"> <xsl:call-template
name="string.subst">
<xsl:with-param name="string" select="$amp.escaped"/>
<xsl:with-param name="target" select="'"'"/>
<xsl:with-param name="replacement"
select="'&quot;'"/>
</xsl:call-template> </xsl:variable> <xsl:variable
name="angle.escaped"> <xsl:call-template
name="string.subst"> <xsl:with-param
name="string" select="$quot.escaped"/>
<xsl:with-param name="target" select="'<'"/>
<xsl:with-param name="replacement"
select="'&lt;'"/>
</xsl:call-template> </xsl:variable> <xsl:variable
name="ndash.escaped"> <xsl:call-template
name="string.subst">
<xsl:with-param name="string"
select="$angle.escaped"/>
<xsl:with-param name="target"
select="'–'"/>
<xsl:with-param name="replacement" select="'-'"/>
</xsl:call-template> </xsl:variable> <xsl:variable
name="mdash.escaped"> <xsl:call-template
name="string.subst">
<xsl:with-param name="string"
select="$ndash.escaped"/>
<xsl:with-param name="target"
select="'—'"/>
<xsl:with-param name="replacement" select="'-'"/>
</xsl:call-template> </xsl:variable> <xsl:variable
name="lsquo.escaped"> <xsl:call-template
name="string.subst">
<xsl:with-param name="string"
select="$mdash.escaped"/>
<xsl:with-param name="target"
select="'‘'"/>
<xsl:with-param name="replacement"
select="$quote.char"/>
</xsl:call-template> </xsl:variable> <xsl:variable
name="rsquo.escaped"> <xsl:call-template
name="string.subst">
<xsl:with-param name="string"
select="$lsquo.escaped"/> <xsl:with-param
name="target" select="'’'"/>
<xsl:with-param name="replacement"
select="$quote.char"/>
</xsl:call-template> </xsl:variable> <xsl:variable
name="ldquo.escaped"> <xsl:call-template
name="string.subst"> <xsl:with-param
name="string" select="$rsquo.escaped"/>
<xsl:with-param name="target"
select="'“'"/>
<xsl:with-param name="replacement"
select="'&quot;'"/>
</xsl:call-template> </xsl:variable> <xsl:variable
name="rdquo.escaped"> <xsl:call-template
name="string.subst">
<xsl:with-param name="string"
select="$ldquo.escaped"/>
<xsl:with-param name="target"
select="'”'"/>
<xsl:with-param name="replacement"
select="'&quot;'"/>
</xsl:call-template> </xsl:variable> <xsl:value-of
select="$rdquo.escaped"/> </xsl:template> From: Bob Stayton
[mailto:bobs@sagehill.net] The problem is that the default output encoding for
htmlhelp is iso-8859-1 and those characters are not in that encoding. But
you can use windows-1252 for the encoding with Saxon. See the
"Languages and Encoding" section of this reference: |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]