<xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
</xsl:if>
</xsl:if>
- <xsl:apply-templates select="." mode="title.markup"/>
+ <xsl:call-template name="escape-attr">
+ <xsl:with-param name="value">
+ <xsl:apply-templates select="." mode="title.markup"/>
+ </xsl:with-param>
+ </xsl:call-template>
</xsl:variable>
<xsl:if test="$htmlhelp.hhc.show.root != 0">
<xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
</xsl:if>
</xsl:if>
- <xsl:apply-templates select="." mode="title.markup"/>
+ <xsl:call-template name="escape-attr">
+ <xsl:with-param name="value">
+ <xsl:apply-templates select="." mode="title.markup"/>
+ </xsl:with-param>
+ </xsl:call-template>
</xsl:variable>
<xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
</xsl:if>
</xsl:template>
-<xsl:template match="part|reference|preface|chapter|bibliography|appendix|article|colophon|glossary"
+<xsl:template match="part|reference|preface|chapter|bibliography|appendix|article|glossary"
mode="hhc">
<xsl:variable name="title">
<xsl:if test="$htmlhelp.autolabel=1">
<xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
</xsl:if>
</xsl:if>
- <xsl:apply-templates select="." mode="title.markup"/>
+ <xsl:call-template name="escape-attr">
+ <xsl:with-param name="value">
+ <xsl:apply-templates select="." mode="title.markup"/>
+ </xsl:with-param>
+ </xsl:call-template>
</xsl:variable>
<xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
<xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
</xsl:if>
</xsl:if>
- <xsl:apply-templates select="." mode="title.markup"/>
+ <xsl:call-template name="escape-attr">
+ <xsl:with-param name="value">
+ <xsl:apply-templates select="." mode="title.markup"/>
+ </xsl:with-param>
+ </xsl:call-template>
</xsl:variable>
<xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
<xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
</xsl:if>
</xsl:if>
- <xsl:apply-templates select="." mode="title.markup"/>
+ <xsl:call-template name="escape-attr">
+ <xsl:with-param name="value">
+ <xsl:apply-templates select="." mode="title.markup"/>
+ </xsl:with-param>
+ </xsl:call-template>
</xsl:variable>
<xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
<xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
</xsl:if>
</xsl:if>
- <xsl:apply-templates select="." mode="title.markup"/>
+ <xsl:call-template name="escape-attr">
+ <xsl:with-param name="value">
+ <xsl:apply-templates select="." mode="title.markup"/>
+ </xsl:with-param>
+ </xsl:call-template>
</xsl:variable>
<xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
<xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
</xsl:if>
</xsl:if>
- <xsl:apply-templates select="." mode="title.markup"/>
+ <xsl:call-template name="escape-attr">
+ <xsl:with-param name="value">
+ <xsl:apply-templates select="." mode="title.markup"/>
+ </xsl:with-param>
+ </xsl:call-template>
</xsl:variable>
<xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
<xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
</xsl:if>
</xsl:if>
- <xsl:apply-templates select="." mode="title.markup"/>
+ <xsl:call-template name="escape-attr">
+ <xsl:with-param name="value">
+ <xsl:apply-templates select="." mode="title.markup"/>
+ </xsl:with-param>
+ </xsl:call-template>
</xsl:variable>
<xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
<xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
</xsl:if>
</xsl:if>
- <xsl:apply-templates select="." mode="title.markup"/>
+ <xsl:call-template name="escape-attr">
+ <xsl:with-param name="value">
+ <xsl:apply-templates select="." mode="title.markup"/>
+ </xsl:with-param>
+ </xsl:call-template>
</xsl:variable>
<xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
<xsl:template name="write.indexterm.hhk">
<xsl:param name="text"/>
<xsl:param name="seealso"/>
+ <xsl:variable name="text.escaped">
+ <xsl:call-template name="escape-attr">
+ <xsl:with-param name="value" select="$text"/>
+ </xsl:call-template>
+ </xsl:variable>
+
<![CDATA[<LI> <OBJECT type="text/sitemap">
- <param name="Name" value="]]><xsl:value-of select="$text"/><xsl:text><![CDATA[">]]></xsl:text>
+ <param name="Name" value="]]><xsl:value-of select="$text.escaped"/><xsl:text><![CDATA[">]]></xsl:text>
<xsl:if test="not(seealso)">
<xsl:variable name="href">
<xsl:call-template name="href.target.with.base.dir"/>
</xsl:variable>
<xsl:variable name="title">
- <xsl:call-template name="nearest.title">
- <xsl:with-param name="object" select=".."/>
+ <xsl:call-template name="escape-attr">
+ <xsl:with-param name="value">
+ <xsl:call-template name="nearest.title">
+ <xsl:with-param name="object" select=".."/>
+ </xsl:call-template>
+ </xsl:with-param>
</xsl:call-template>
</xsl:variable>
<![CDATA[<param name="Name" value="]]><xsl:value-of select="$title"/><![CDATA[">]]>
<xsl:value-of select="document('')//h:hex/d[$digit+1]"/>
</xsl:template>
+<!-- ==================================================================== -->
+<!-- Template for escaping <, & and " in attribute values.
+ We aren't using HTML output method, so we must do this job ourselves -->
+
+<xsl:template name="escape-attr">
+ <xsl:param name="value"/>
+
+ <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:value-of select="$angle.escaped"/>
+
+</xsl:template>
+
+
</xsl:stylesheet>