Prevent format copying into a DITA-table (Author view)

Oleksii
Posts: 46
Joined: Wed Jul 19, 2017 6:04 pm
Location: Austria
Contact:

Prevent format copying into a DITA-table (Author view)

Post by Oleksii » Mon Sep 23, 2019 12:49 pm

Hi,
when copying code from our web-interface (click on a musical element) and paste it into a DITA-table Author view, an element

Code: Select all

<pre>
is added automatically.
It would be basically OK, but also an ID is added which is same for all <pre>-Elements and causes a validation error.
Is it possible to manage this behavior?
Please, see the screenshots in the attachment.
Oleksii

copy-paste-dita.zip
(36.53 KiB) Downloaded 8 times

Radu
Posts: 6541
Joined: Fri Jul 09, 2004 5:18 pm

Re: Prevent format copying into a DITA-table (Author view)

Post by Radu » Mon Sep 23, 2019 3:38 pm

Hi Oleksii,

When you copy something from the web browser and paste in Oxygen, Oxygen receives HTML content. It then applies this XSLT stylesheet:

OXYGEN_INSTALL_DIR\frameworks\dita\resources\xhtml2ditaDriver.xsl

to convert the HTML content to DITA so one possibility would be to add some further processing to the XSLT stylesheet there. I do not know where exactly that ID comes from but it's inside the HTML fragment received by Oxygen from the Web Browser.
As other workarounds:
- If you right click inside the Author visual editing mode there is a "Paste Special" submenu which allows you to "Paste as Text".
- In the Oxygen Preferences->"Editor / Edit Modes / Author / Schema-Aware" page you can uncheck the "Convert external content on paste" checkbox.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Oleksii
Posts: 46
Joined: Wed Jul 19, 2017 6:04 pm
Location: Austria
Contact:

Re: Prevent format copying into a DITA-table (Author view)

Post by Oleksii » Mon Sep 23, 2019 3:58 pm

Ok, thanks. The preferences option is Ok in my case.

Post Reply