Method "relpath:getParent" does not properly work on Windows
Brought to you by:
drmacro
The XSL:
DITA-OT/plugins/net.sourceforge.dita4publishers.common.xslt/xsl/lib/relpath_util.xsl
has a method:
<xsl:function name="relpath:getParent" as="xs:string"> <xsl:param name="sourcePath" as="xs:string"/> <xsl:value-of select="string-join(tokenize($sourcePath, '/')[position() < last()], '/')"/> </xsl:function>
which does not work properly on Windows because the directories are separated by "\" so in order for it to properly work on Windows you could do something like:
<xsl:function name="relpath:getParent" as="xs:string"> <xsl:param name="sourcePath" as="xs:string"/> <xsl:variable name="correctedSourcePath" select="replace($sourcePath, '\\', '/')"/> <xsl:value-of select="string-join(tokenize($correctedSourcePath, '/')[position() < last()], '/')"/> </xsl:function>
As a side effect of the problem on Windows the HTML2 output does not show images.
Anonymous