From: <bob...@us...> - 2014-02-18 00:01:49
|
Revision: 9903 http://sourceforge.net/p/docbook/code/9903 Author: bobstayton Date: 2014-02-18 00:01:45 +0000 (Tue, 18 Feb 2014) Log Message: ----------- Improve the handling of $chunk.base.dir when $base.dir contains the OEBPS directory in its value. Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2014-02-17 19:40:26 UTC (rev 9902) +++ trunk/xsl/epub/docbook.xsl 2014-02-18 00:01:45 UTC (rev 9903) @@ -40,29 +40,29 @@ <!-- 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="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) = '/'"> - <xsl:value-of select="$base.dir"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="concat($base.dir, '/')"/> - </xsl:otherwise> - </xsl:choose> - <xsl:value-of select="$epub.oebps.dir"/> + <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) = '/'"> + <xsl:value-of select="$base.dir"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat($base.dir, '/')"/> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$epub.oebps.dir"/> <xsl:if test="substring($epub.oebps.dir, string-length($epub.oebps.dir), 1) != '/'"> <xsl:text>/</xsl:text> </xsl:if> - </xsl:variable> - + </xsl:variable> + <!-- This param only has a side effect of checking for base.dir usage --> <xsl:param name="epub.ncx.filename" select="'toc.ncx'"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |