Page 1 of 1

Paste relative path

Posted: Tue Oct 04, 2022 4:39 pm
by steelejc15425
I know that there are many different options under Paste Special, but I can't find a way to paste a relative path in Author mode. Perhaps someone can help.

A little context: I have a folder structure that is identical for several different languages. I'm working in DITA. When I'm working in content across languages, I want to reproduce the same references. If I have a relative path in an image element in English it might look something like this in plain text:
../../pictures/pretty_flower.png

If I copy the image element and paste it into my German content, I'd like to get the exact same path, but instead I get something like:
../../../../Presentation/en-US/pictures/pretty_flower.png
Which means that the conref goes to my English version of the image instead of to the image in the set of German folders.

I can work around this by switching back and forth to Text mode. Any other solution?

Re: Paste relative path

Posted: Wed Oct 05, 2022 11:53 am
by alex_jitianu
Hello,

I'm sorry for the inconvenience! We already fixed this behavior for the next Oxygen version, 25, which should be released in a couple of weeks.
What Oxygen version are you using? Perhaps we can integrate the fix in a maintenance release for version 24.1.

Best regards,
Alex

Re: Paste relative path

Posted: Wed Oct 05, 2022 3:02 pm
by chrispitude
Hi Alex,

In our environment, we rely on @href attributes being updated when DITA elements are copied from one place to another.

For example, if I have the following content in dir/topic1.dita:

Code: Select all

<topic id="topic_in_dir">
    <title>Topic in dir</title>
    <body>
        <p conref="../warehouse/warehouse.dita#warehouse/lorem"/>
        <p>See <xref href="../warehouse/warehouse.dita#warehouse"/>.</p>
        <image href="oxygen190x62.png" placement="break" id="image_k25_v1x_bvb"/>
    </body>
</topic>
and I copy and paste this <body> element into a topic file in a lower directory, at dir/subdir/topic2.dita, then I need Oxygen to adjust the @href values for me:

Code: Select all

<topic id="topic_in_dir_subdir">
    <title>Topic in dir/subdir</title>
    <body>
        <p conref="../../warehouse/warehouse.dita#warehouse/lorem"/>
        <p>See <xref href="../../warehouse/warehouse.dita#warehouse"/>.</p>
        <image href="../oxygen190x62.png" placement="break" id="image_k25_v1x_bvb"/>
    </body>
</topic>
Will this fix eliminate this @href-adjustment feature for us?

Here is a testcase:

oxygen_paste_adjust_path.zip
(7.47 KiB) Downloaded 124 times

Re: Paste relative path

Posted: Wed Oct 05, 2022 3:17 pm
by chrispitude
Related to this, we filed EXM-49471 to request similar @href-adjustment for copying files in the Project view:

Update outgoing (but not incoming) references when Main Files content is copied

Re: Paste relative path

Posted: Wed Oct 05, 2022 3:41 pm
by steelejc15425
I'm on <oXygen/> XML Editor 24.1, build 2022062007, but it seems like if 25 will be out in a couple of weeks that would be plenty fast enough for me :D Will demonstrations of 25 be available right away?

Re: Paste relative path

Posted: Wed Oct 05, 2022 4:26 pm
by alex_jitianu
Hi Chris,

Chris, I'm sorry I didn't give more details on the matter. The fix I was referring to works like this. We first verify if the file referred by @href value actually exists in the new context. If it does, then we keep the @href attribute untouched. If the target doesn't exist then we rewrite it.
Will demonstrations of 25 be available right away?
Video demonstrations for the new features will be available with the release.

Best regards,
Alex

Re: Paste relative path

Posted: Wed Oct 05, 2022 5:46 pm
by chrispitude
Thanks Alex! This sounds like a good adaptive solution. I can't think of a practical case in our environment where a reference would happen to accidentally exist at the new location.

Re: Paste relative path

Posted: Thu Oct 13, 2022 5:03 pm
by alex_jitianu
Hi,

We've just released Oxygen 25, in which we've corrected the path rewriting as described above. I hope it helps!

Best regards,
Alex