Pages: 1
Print
Author Topic: XMetaL 11 Unable to resolve paths with file://  (Read 482 times)
nouspoetikos
Member

Posts: 2


« on: February 16, 2017, 06:49:32 AM »

Hello,

When a file contains a link or xref to a dita source file located on another machine, for example:
<xref href=file://lw5mlpdsy/WS/RELEASE_DOC/R420/BSFDOCEN/AadDoc/AadUserResources.doc/src/testfile.xml format="dita" scope="local"></xref>

The xref or link is not resolved in the published output.
Is there a specific syntax we can use to work around this problem or is this simply no longer supported by the toolkit?

This problem concerns XMetaL 11.
In the previous version of XMetaL we used (XMetaL 7) this problem did not exist.

Here's the error output we get in the log:

topicpull:
[topicpull] Transforming into C:\PROGRA~3\SoftQuad\XMetaL\Shared\DITA_OT2.2\temp
[topicpull] Loading stylesheet C:\PROGRA~3\SoftQuad\XMetaL\Shared\DITA_OT2.2\xsl\preprocess\topicpull.xsl
[topicpull] Processing C:\PROGRA~3\SoftQuad\XMetaL\Shared\DITA_OT2.2\temp\testfile.xml
[topicpull] Recoverable error on line 597 of topicpullImpl.xsl:
[topicpull]   FODC0002: java.io.FileNotFoundException:
[topicpull]   C:\PROGRA~3\SoftQuad\XMetaL\Shared\DITA_OT2.2\temp\WS\RELEASE_DOC\R420\BSFDOCEN\AadDoc\AadUserResources.doc\src\testfile.xml (The system cannot find the path specified)
[topicpull] file:/E:/tmp/testfile.xml:11:31: [DOTX031E][ERROR]: The file file:/C:/PROGRA~3/SoftQuad/XMetaL/Shared/DITA_OT2.2/temp/WS/RELEASE_DOC/R420/BSFDOCEN/AadDoc/AadUserResources.doc/src/testfile.xml is not available to resolve link information.
[topicpull] Recoverable error on line 675 of topicpullImpl.xsl:
[topicpull]   FODC0002: java.io.FileNotFoundException:
[topicpull]   C:\PROGRA~3\SoftQuad\XMetaL\Shared\DITA_OT2.2\temp\WS\RELEASE_DOC\R420\BSFDOCEN\AadDoc\AadUserResources.doc\src\testfile.xml (The system cannot find the path specified)
[topicpull] Recoverable error on line 1102 of topicpullImpl.xsl:
[topicpull]   FODC0002: java.io.FileNotFoundException:
[topicpull]   C:\PROGRA~3\SoftQuad\XMetaL\Shared\DITA_OT2.2\temp\WS\RELEASE_DOC\R420\BSFDOCEN\AadDoc\AadUserResources.doc\src\testfile.xml (The system cannot find the path specified)
[topicpull] Recoverable error on line 1828 of topicpullImpl.xsl:
[topicpull]   FODC0002: java.io.FileNotFoundException:
[topicpull]   C:\PROGRA~3\SoftQuad\XMetaL\Shared\DITA_OT2.2\temp\WS\RELEASE_DOC\R420\BSFDOCEN\AadDoc\AadUserResources.doc\src\testfile.xml (The system cannot find the path specified)


Thanks!
« Last Edit: February 16, 2017, 06:52:04 AM by nouspoetikos » Logged
Fa
Member

Posts: 18


« Reply #1 on: February 23, 2017, 03:07:45 AM »

I also have a very similar issue (in XMetaL 11 too).

I have created a small DITA map with a few topics that I keep always in the same location (a drive on our intranet, mapped on my computer). This DITA map (let's call it ComRef, for common references) will then be included in all my manuals (indented or embedded or however you want to call it in my manual DITA maps). The idea, since this is general information, is that if there is something to be updated, we correct it once here, and then any manual we generate subsequently will get the updated info.

Then I have created a template for my manuals. This template is a DITA map with several topics, and in it I have embedded the ConRef map (well, a link to it). The idea is that I can take that template and copy it anywhere on my local machine or network and it would work. This means I should be working with absolute paths, where by default XMetaL creates a relative path to the ConRef map (is there any way to change that?).

Unfortunately this ConRef map is not rendered in the pdf output. The only thing that works is if the embedded ConRef map is in the same folder or a subfolder of where my template map is, which defeats the purpose.

What I have tried unsuccessfully:

- Change the ConRef map path from relative to absolute.
- Change the reference to the map to topicref instead of mapref (XMetaL 6.0 created a topicref for embedded maps, so I gave it a shot)

I have tested this with my old XMetaL 6.0, and there there was no issue. The output pdf is created without problem and has the embedded ConRef map material in it.

I now finally seem to have solved it (partially). The trick was to work my way through the path of both maps and renaming everything so as not to have any space (in the folder names but also in the map names). At least this worked with a relative path, I still have to test with an absolute path. But this is very unpractical! I have thousands of folders, so I cannot obviously be expected to rename them all.

Anyway, hope this will help you and maybe put you on the right track to solve your own issue...

Regards
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2469



WWW
« Reply #2 on: February 27, 2017, 07:04:13 PM »

Referencing files outside the folder of the map file is not something the DITA Open Toolkit has really supported. You may wish to follow this discussion: https://github.com/dita-ot/dita-ot/issues/1762

However, you might try using the DITA OT parameter "generate.copy.outer" documented here:
http://www.dita-ot.org/2.0/readme/tool-parameters-common-html-transformation.html
http://www.dita-ot.org/2.0/readme/generate-copy-outer.html

That parameter can be set using Tools > Configure Output on the Advanced tab by adding the following into the "Other output parameters" section:

ANT_PARAM_generate.copy.outer  =  3

That should help in the case where your file is outside the folder structure of the map, but not in the case where it is on another computer.

If that parameter does not help then the version of the DITA OT being run may have some issues.
By default the version of the DITA OT that is run with XMetaL Author Enterprise 11 is DITA OT 2.4, however, version 2.2 is also installed. You can change the DITA OT version to 2.2 by swapping the underscores between these two settings:

DITA_OT_DIR  =  %XMETAL_SHARED_ALL%\DITA_OT2.4
__DITA_OT_DIR  =  %XMETAL_SHARED_ALL%\DITA_OT2.2


As far as I know there are no parameters supported by the DITA OT itself that allow you to reference files on another computer and have that content be parsed as an input file to the DITA OT (map or topic).

However, if you are generating output to PDF or some other file format  that results in a single file (CHM maybe) then you might try the XMetaL Author Enterprise setting "cmd_fs_sandboxing  =  yes". This setting was created specifically to support the Japanese edition of XMetaL Author Enterprise but may help in other situations. Most Japanese authors name their files using Japanese characters (of course) but the DITA OT generally cannot handle non-alphanumeric file names. This setting creates a copy of all referenced files (this is the part that would help with your files on the server), renames them using alphanumeric characters (in order to get around the Japanese language issue), and adjusts all links to point to the new file names. You can set this in Tools > Configure Output on the Advanced tab inside the "Other output parameters" section:
cmd_fs_sandboxing  =  yes

If you are generating output to an HTML-based format then having files outside the map's directory structure might make sense, but for most people I don't think it does. References to files outside the map's directory structure are usually to existing files that are not expected to be copied or moved. Regardless, when you reference a file in a folder that is outside the map's folder structure but on the same drive then the DITA OT can create an additional folder for that file (see the setting ANT_PARAM_generate.copy.outer above). However, in cases where a file is located on a different drive or a different computer the behaviour is undefined. The cmd_fs_sandboxing parameter can help because it effectively flattens the entire folder structure, but that may not be wanted because it also renames files. That's necessary because of the folder flattening, and is probably a minor issue unless your readers use the file names to navigate.

The best solution, probably for all possible cases, is to store, edit and generate output from local files. In cases where you wish to share or store files centrally you can have them delivered locally by a CMS or some other system before asking the DITA OT to do anything with them to avoid limitations with the DITA OT.
Logged
Pages: 1
Print
Jump to: