fileref is replacing relative path with full path

Posts: 9

fileref is replacing relative path with full path

Fri Aug 23, 2013 4:16 pm

I am generating WebHelp from my DocBook files using <oXygen/> XML Editor 15.0. I have some inline graphics in my documents. For example, <imagedata fileref="images/information.jpg"/>

When I generate WebHelp using DocBook WebHelp, my fileref path is replaced with a full path. For example, file:///C:/Users/.../images/information.jpg

This is fine when viewing on my computer, but when I copy the output to the website obviously there is a problem.

The path remains relative if I generate WebHep using DocBook WebHelp (old). I prefer the "new" WebHelp. I've tried changing various parameters with no success.

Thanks in advance for any help you can provide.
Posts: 4144

Re: fileref is replacing relative path with full path

Fri Aug 23, 2013 5:27 pm

Sorry, I cannot reproduce this problem with the built-in DocBook WebHelp transformation, (which is the "new" WebHelp transformation that you need) applied on one of the sample Docbook XML file that come in the default Oxygen project (the project file samples/sample.xpr loaded in the Project view). For example in the XML file I have:

Code: Select all

  <title>Properties for a Windows Drive</title>
      <imagedata fileref="images/drive-properties.jpg" scale="75"/>

and in the result HTML page from the out/webhelp directory I have:

Code: Select all

<div class="mediaobject"><img src="images/drive-properties.jpg" width="405" alt="Properties for a Windows Drive"/></div>

Can you send us a zip archive with some sample files that show the problem? Please include a sample Docbook XML file and the output directory out/webhelp of the Webhelp transformation applied to this Docbook XML file.

Posts: 9

Re: fileref is replacing relative path with full path

Fri Aug 23, 2013 6:21 pm

I went back to the original DocBook WebHelp scenario to generate my WebHelp. The image path generated properly. Curious about what I had done to mess this up, I compared the parameters in the original DocBook WebHelp scenario with the parameters I had in my copy "DocBook WebHelp - Uehling"

I am replacing an existing WebHelp that uses "htm" file extensions rather than "html". So, I set the html.ext parameter to .htm

I discovered that when this parameter is .html, then my <imagedata fileref="images/information.jpg"/> behaves -- that is the path remains relative.

When I change the parameter to to .htm, I get the filename extensions that I want, but the image path becomes the full path to my C:\ drive.

Is there a reason why changing the html.ext parameter would cause my image path to go goofy?

Thanks for your patience in helping me through this.
Posts: 5811

Re: fileref is replacing relative path with full path

Mon Aug 26, 2013 3:05 pm


Thanks for finding the cause for this. We also managed to reproduce the issue on our side.
It is a bug in Oxygen and we'll try to fix it in Oxygen 15.1 in a couple of weeks.
In the meantime if you open the build file:


at a certain point it has some code like:

Code: Select all

 <foreach target="images" param="inputFile">
                <fileset dir="${output.dir}">
                    <include name="*.html"/>
                    <exclude name="index.html"/>
                    <exclude name="toc.html"/>
        <copy todir="${output.dir}" overwrite="true" encoding="UTF-8">
            <fileset dir="${output.dir}/temp_modified_pages">
                <include name="*.html"/>

As you can see the code looks in 4 places explicitly for the "html" extension and you can change that to look for the "htm" extension.

Radu Coravu
<oXygen/> XML Editor

Return to “DocBook”

Who is online

Users browsing this forum: No registered users and 0 guests