]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix up chunk.base.dir if it contains OEBPS, instead of generating an error.
authorBob Stayton <bobs@sagehill.net>
Mon, 17 Feb 2014 19:40:26 +0000 (19:40 +0000)
committerBob Stayton <bobs@sagehill.net>
Mon, 17 Feb 2014 19:40:26 +0000 (19:40 +0000)
xsl/epub3/epub3-element-mods.xsl

index ad7792d63987bb4f0abb96ef2fb978f48bc50f87..8e202bfb90b8c62219d77cd583ac51e89d1af0af 100644 (file)
@@ -52,14 +52,14 @@ article  toc,title,figure,table,example,equation
 
 <!-- HTML chunk output goes to $base.dir/OEPBS -->
 <xsl:variable name="chunk.base.dir">
-  <xsl:if test="$base.dir != '' and contains($base.dir, $epub.oebps.dir)">
-    <xsl:message terminate="yes">
-      <xsl:text>ERROR: the $base.dir param must not include the </xsl:text>
-      <xsl:value-of select="$epub.oebps.dir"/>
-      <xsl:text> directory in its path. Exiting.</xsl:text>
-    </xsl:message>
-  </xsl:if>
   <xsl:choose>
+    <xsl:when test="$base.dir != '' and contains($base.dir, $epub.oebps.dir)">
+      <xsl:value-of select="substring-before($base.dir, $epub.oebps.dir)"/>
+    </xsl:when>
+    <!-- If epub.oebps.dir reset but base.dir still has OEBPS: -->
+    <xsl:when test="$base.dir != '' and contains($base.dir, 'OEBPS')">
+      <xsl:value-of select="substring-before($base.dir, 'OEBPS')"/>
+    </xsl:when>
     <xsl:when test="string-length($base.dir) = 0"></xsl:when>
     <!-- make sure to add trailing slash if omitted by user -->
     <xsl:when test="substring($base.dir, string-length($base.dir), 1) = '/'">