Open raducoravu opened 9 years ago
I was in the process of implementing these changes when I ran into inconsistent behavior under Windows and got sidetracked trying to understand why it was happening. But these fixes are in progress.
One more suggestion to make mathml refs properly work even when the mathml equation is in a folder structure with spaces in it. In the file relpath_util.xsl the function "relpath:toUrl" should be slightly modified like:
<xsl:function name="relpath:toUrl" as="xs:string">
<xsl:param name="filepath" as="xs:string"/>
<xsl:variable name="url" as="xs:string"
select="if (contains($filepath, '\'))
then translate($filepath, '\', '/')
else $filepath
"
/>
<xsl:variable name="fileUrl" as="xs:string"
select="
if (matches($url, '^[a-zA-Z]:'))
then concat('file:/', $url)
else if(starts-with($url, '/')) then concat('file:', $url) else $url"
/>
<xsl:sequence select="replace($fileUrl, ' ', '%20')"/>
</xsl:function>
so that it does two extra things:
1) If the initial URL fragment starts with "/", it means it is a Linux file path and we need to prepend file: to it. 2) Replace simple spaces with url encoded version.
This worked for me.
My DITA topic has something like:
and my DITA Map:
The PDF does not contain the image (Windows OS). I found two problems so far in the XSLT stylesheet:
1) The variable "keydefsURI" needs to be properly converted from file path to URL using "relpath:toUrl":
2) When the "mappath" variable is used, it needs to be properly converted from file path to URL:
After making these changes, it works for me.