How to suppress copying “id” attribute when pasting XML elements into another module

Oxygen general issues.
A499Z4F
Posts: 2
Joined: Thu Nov 13, 2025 9:16 am

How to suppress copying “id” attribute when pasting XML elements into another module

Post by A499Z4F »

Hello Team,
We are facing an issue related to the automatic handling of the unique attribute id when copying and pasting elements between modules in Oxygen.

Current Behavior
When copying an element within the same module, Oxygen correctly suppresses the id attribute and does not paste it.
But when copying an element from one module to another module, Oxygen pastes the element along with the existing id attribute, which our users do not want.
This results in duplicate IDs and violates the uniqueness constraints defined in our DTD.

What Customer Want
When pasting an element into any other module, Oxygen should automatically suppress/remove the "id" attribute, exactly as it already does when pasting inside the same module.

What We Tried
We analyzed all related configuration points together with Docufy, but we could not identify where or how Oxygen internally controls this behavior.
It seems Oxygen has some built-in logic to suppress IDs during paste, but we cannot find the extension point or API to override/customize this behavior for cross-module paste operations.

Question
Could you please guide us on:

1. How Oxygen controls the decision to keep or suppress attributes during paste?
2. Whether there is an API, plugin hook, author operation, or framework setting that allows us to remove specific attributes (like id) when pasting content from one module to another?
3. If such behavior is part of Oxygen’s internal implementation, is there a recommended extension/customization point to override it?

Refer attachment for "id" attribute
GPLMTPS-6118.png
You do not have the required permissions to view the files attached to this post.
Radu
Posts: 9564
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to suppress copying “id” attribute when pasting XML elements into another module

Post by Radu »

Hi,
So you are using a custom XML vocabulary, as far as I know by default when editing an XML document in the Author visual mode and copy pasting content inside it or to another file, Oxygen does not filter out any attribute, including IDs.
Or is your custom XML vocabulary a specialization based on an Oxygen framework like DITA XML?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
A499Z4F
Posts: 2
Joined: Thu Nov 13, 2025 9:16 am

Re: How to suppress copying “id” attribute when pasting XML elements into another module

Post by A499Z4F »

Hi Radu,
Thanks for the quick response.
Let me clarify our setup:
• We are not using DITA.
• We are using custom XML vocabulary with its own DTD.
• We are working inside a Docufy plugin, which is integrated with Oxygen Author.
• The behavior we see is that Oxygen suppresses the id attribute only when pasting within the same module (same XML file).
• However, when copying the same element and pasting it into a different XML file (another module), Oxygen retains the id attribute.
This difference in behavior is what we are trying to understand.

What we are trying to achieve
We need to remove the id attribute automatically when pasting into a different module, similar to how Oxygen behaves when pasting inside the same document.

What we tried
We checked all possible configurations together with Docufy, but could not find:
framework setting, an Author extension point, an API hook (like AuthorOperation, AuthorListener, or ro.sync.ecss.extensions.api)
that controls attribute filtering during paste operations.

Best Regards,
Abhay
Radu
Posts: 9564
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to suppress copying “id” attribute when pasting XML elements into another module

Post by Radu »

Hello Abhay,
If the company which implemented the XML framework configuration for Oxygen extended this API class "ro.sync.ecss.extensions.api.ExtensionsBundle", it has a method which can be extended "ro.sync.ecss.extensions.api.ExtensionsBundle.getClipboardFragmentProcessor()". The ClipboardFragmentProcessor's method "ClipboardFragmentProcessor#process" is called when content gets pasted in a topic, maybe this extension point was implemented to act as you mentioned.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply