question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

copy-to fails to update image paths

See original GitHub issue

I have a topic in the directory topics/ that includes two image references (one with a relative path, one with a key). Both images are located in the peer images/ directory:

<ul>
<li>Image with relatve path: <image href="../images/happycat.jpg" alt="yuk"/></li>
<li>Image with key: <image keyref="flag"/></li>
</ul>

In my map, I publish that topic as-is; I also use @copy-to to copy it up a directory, down a directory, and to a peer directory.

My rendered HTML5 output has four copies of the topic (original, copied up, copied to peer, copied down). In all 4 versions, the original relative path ../images/ is used. This is true for both the relative-path version and the keyref version. As a result, the rendered topic is only valid in the original and peer directories. copyimage.zip

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
raducoravucommented, Sep 23, 2016

I first reproduced the initial problem on 2.3.2. The problem could be reproduced in the XHTML outputs, the PDF worked. I updated to the latest 2.3.3 github branch, run gradle. The XHTML output looks fixed, images appear in all HTML topics. The PDF output is broken though:

        map2pdf2:
        [topic-merge] Processing C:\Users\radu_coravu\Desktop\copy-image\temp\pdf\oxygen_dita_temp\P024801.ditamap
        [topic-merge] Processing C:\Users\radu_coravu\Desktop\copy-image\temp\pdf\oxygen_dita_temp\topics\test.dita
        [topic-merge] Failed to parse topics\test.dita: Illegal character in path at index 6: topics\test.dita
        [topic-merge] Error at xsl:element on line 64 of topicmergeImpl.xsl:
        [topic-merge]   XTDE0820: Invalid element name. Invalid QName {}
        [topic-merge]   in built-in template rule
0reactions
marknymacommented, Oct 22, 2018

Regarding the original issue, if the dita file in @href cannot be located (like a missing file etc.) we get a freak “Error: java.lang.NullPointerException” and naturally the transformation fails with no info as to what would be the actual problem.

Easy to reproduce with the copyimage example, just rename the test.dita file to something else.

There should be a more concise error message in this situation.

We are using dita-ot v2.5.4 with the oXygen WebHelp transformation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A file copy operation fails when files or folders have long paths ...
The copy operation fails and generates a message that states that the path (file name) is too long. The message also suggests that...
Read more >
Update image-files in a specific directory - Stack Overflow
So far, everything seems to be ok, but how to pass an image from the First directory to the Second directory which is...
Read more >
How to specify a path to a file in MATLAB Drive when using ...
My suggestion is to add the images folder and subfolders to your path. Right click on the folder and select Add to path...
Read more >
Copying a File or Directory - The Java™ Tutorials
You can copy a file or directory by using the copy(Path, Path, CopyOption...) method. The copy fails if the target file exists, unless...
Read more >
FileInfo.CopyTo UnauthorizedAccessException Error ... - GitHub
Hello, Im trying to copy some files within an external exfat drive. As we all know, exfat in linux ubuntu belongs to root...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found