]> granicus.if.org Git - docbook-dsssl/commitdiff
escape single quotation marks in ToC for titles and titleabbrev in
authorMichael Smith <xmldoc@users.sourceforge.net>
Wed, 4 May 2005 20:17:12 +0000 (20:17 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Wed, 4 May 2005 20:17:12 +0000 (20:17 +0000)
foilgroup and foil (closes bug #1194308; thanks to Tomas Hajek for
reporting the bug)

slides/xsl/html/frames.xsl

index e2bd8db159bf7d66db485de5d2e32f785324c8aa..759071e479bfd8963f68da45ee060ba2ca5ac62d 100644 (file)
@@ -1948,14 +1948,20 @@ function init() {
   <xsl:apply-templates select="." mode="filename"/>
   <xsl:text disable-output-escaping="yes">" target="foil"&gt;</xsl:text>
 
-  <xsl:choose>
-    <xsl:when test="titleabbrev">
-      <xsl:value-of select="titleabbrev"/>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:value-of select="title"/>
-    </xsl:otherwise>
-  </xsl:choose>
+  <xsl:call-template name="string.subst">
+    <xsl:with-param name="string">
+      <xsl:choose>
+        <xsl:when test="titleabbrev">
+          <xsl:value-of select="titleabbrev"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="title"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:with-param>
+    <xsl:with-param name="target">'</xsl:with-param>
+    <xsl:with-param name="replacement">\'</xsl:with-param>
+  </xsl:call-template>
 
   <xsl:text disable-output-escaping="yes">&lt;\/a&gt;&lt;\/div&gt;</xsl:text>
   <xsl:text>');&#10;</xsl:text>
@@ -1985,14 +1991,20 @@ function init() {
   <xsl:apply-templates select="." mode="filename"/>
   <xsl:text disable-output-escaping="yes">" target="foil"&gt;</xsl:text>
 
-  <xsl:choose>
-    <xsl:when test="titleabbrev">
-      <xsl:value-of select="titleabbrev"/>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:value-of select="title"/>
-    </xsl:otherwise>
-  </xsl:choose>
+  <xsl:call-template name="string.subst">
+    <xsl:with-param name="string">
+      <xsl:choose>
+        <xsl:when test="titleabbrev">
+          <xsl:value-of select="titleabbrev"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="title"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:with-param>
+    <xsl:with-param name="target">'</xsl:with-param>
+    <xsl:with-param name="replacement">\'</xsl:with-param>
+  </xsl:call-template>
 
   <xsl:text disable-output-escaping="yes">&lt;\/a&gt;&lt;\/div&gt;</xsl:text>
   <xsl:text>');&#10;</xsl:text>