Reset ID/IDREF when pasting

Are you missing a feature? Request its implementation here.
Pascale
Posts: 40
Joined: Wed Jan 29, 2014 4:30 pm

Reset ID/IDREF when pasting

Post by Pascale »

Would be nice to have the following improvement:
- when pasting an element that contains sub-elements with IDs and sub-elements with IDREF (in the sense of the XML ID and IDREF datatype), could you please reset all the IDs and the corresponding IDREFs so that the cross-references are preserved in the pasted XML and there is no "duplicate ID" error/conflict with the original copy.

Thanks,
Pascale
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: Reset ID/IDREF when pasting

Post by Radu »

Hi Pascale,

In some of the XML vocabularies like DITA, Docbook, TEI for which we have out of the box document type configurations available this removal of IDs when copy/pasting in the Author visual editing mode is done by implementing a special Java extension.
For example you can look in our Author SDK at how the ro.sync.ecss.extensions.dita.id.DITAUniqueAttributesRecognizer is implemented and how it is used from the ro.sync.ecss.extensions.dita.DITAExtensionsBundle.

We could try to also provide a default implementation for this ID attributes removal functionality which would remove all attributes defined as ID-type in the schema. So I will add an improvement request for this.

Regarding IDREFS, the functionality we currently implemented for DITA, Docbook, will not remove them automatically (it only removes IDs) but you can create your own custom Java extension which also tries to remove IDREFS when they refer to IDs in the same copied content. But I don't think we can do this automatically because even if the IDREFs were not removed, they would end up pointing to IDs defined in the original content and it depends whether users would find this useful or not.

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