Relative paths
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 2
- Joined: Thu Aug 07, 2008 9:56 pm
Relative paths
I've been using Docbook 5.0 with XIncludes to create a very nested document so as to avoid repetitive work especially with screenshots etc.
When processing this the text comes out just fine. However the images are not coming out. I know why but I don't know how to fix it.
This is not the problem of loading the additional libraries to support PNG images in PDF.
The requirement is to locate the image file in the same directory as it is used. There are many images (100's) which potentially all have the same name but are distinguished by their position in the path hierarchy.
If I transform from the directory where the images live then all is OK but if I transform from above that or adjacent to it, then the images do not come out. In fact they are included as if there are in the current directory.
For example :-
Now, I know that a relative fileref processed with XInclude and with the parameter keep.relative.image.uris="0" is changed to account for any xml:base attributes. I also know that there is a preference to enable or disable the base URI fixup.
However, all permutations seem to fail in one way or another.
If 'Base URI fix-up' is ticked and keep.relative.image.uris is '1' the image location is the document root.
If 'Base URI fix-up' is ticked and keep.relative.image.uris is '0' the image location is the pathname twice, i.e. one appended after the other.
If 'Base URI fix-up' is unticked and keep.relative.image.uris is '0' the image location is the document root.
If 'Base URI fix-up' is unticked and keep.relative.image.uris is '1' the image location is the document root.
Is there something else I should be doing?
When processing this the text comes out just fine. However the images are not coming out. I know why but I don't know how to fix it.
This is not the problem of loading the additional libraries to support PNG images in PDF.
The requirement is to locate the image file in the same directory as it is used. There are many images (100's) which potentially all have the same name but are distinguished by their position in the path hierarchy.
If I transform from the directory where the images live then all is OK but if I transform from above that or adjacent to it, then the images do not come out. In fact they are included as if there are in the current directory.
For example :-
Code: Select all
<mediaobject>
<imageobject>
<imagedata fileref="rs-001.png"></imagedata>
</imageobject>
</mediaobject>
However, all permutations seem to fail in one way or another.
If 'Base URI fix-up' is ticked and keep.relative.image.uris is '1' the image location is the document root.
If 'Base URI fix-up' is ticked and keep.relative.image.uris is '0' the image location is the pathname twice, i.e. one appended after the other.
If 'Base URI fix-up' is unticked and keep.relative.image.uris is '0' the image location is the document root.
If 'Base URI fix-up' is unticked and keep.relative.image.uris is '1' the image location is the document root.
Is there something else I should be doing?
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Relative paths
Post by sorin_ristache »
Hello,
Regards,
Sorin
Taking your requirement into account the xml:base value that results from the inclusion should not be ignored so this is the permutation that you should use: Base URI fix-up selected and the DocBook parameter keep.relative.image.uris set to the default value (zero). In versions older than 9.3 the path was not computed correctly starting from the second level of inclusion (you said you had a very nested document). The cause was a Xerces bug which we reported to the Xerces team and which we fixed in Oxygen 9.3 (the current version available on the Download page). What Oxygen version do you use?EricR wrote:The requirement is to locate the image file in the same directory as it is used. There are many images (100's) which potentially all have the same name but are distinguished by their position in the path hierarchy.
...
all permutations seem to fail in one way or another.
...
If 'Base URI fix-up' is ticked and keep.relative.image.uris is '0' the image location is the pathname twice, i.e. one appended after the other.
Use Oxygen version 9.3 which fixes the Xerces bug. If version 9.3 does not use the image file from the same directory as the included XML file which points to this image I can send you my test files with 4 levels of inclusion or you can post sample files for reproducing the problem.EricR wrote:Is there something else I should be doing?
Regards,
Sorin
-
- Posts: 2
- Joined: Thu Aug 07, 2008 9:56 pm
Re: Relative paths
I am now using v9.3 build 2008070211.
That solved it.
One thing; I note that the default value of keep.relative.image.uris for PDF output is 0 but for HTML is it 1. I think this is in line with the spec but I don't see the logic behind it.
That solved it.
One thing; I note that the default value of keep.relative.image.uris for PDF output is 0 but for HTML is it 1. I think this is in line with the spec but I don't see the logic behind it.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Relative paths
Post by sorin_ristache »
I see that the default value of keep.relative.image.uris is 1 for HTML output but I agree that it seems strange.
Regards,
Sorin
Regards,
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service