Refactor: change the value of an @xml:id attribute

Are you missing a feature? Request its implementation here.
fsteimke
Posts: 80
Joined: Tue Jan 01, 2013 3:19 pm

Refactor: change the value of an @xml:id attribute

Post by fsteimke »

Hi,

id like to suggest the change of an @xml:id Attribute as a new refactoring action.

Changing the value of an @xml:id attribute requires the change of all references to this attribute. Thats the motivation for this feature request. It would be especially helpfull in Projekts with a master Document to set the scope for changes.

Sincerely, Frank Steimke
adrian_sorop
Posts: 73
Joined: Wed Jun 22, 2016 2:48 pm

Re: Refactor: change the value of an @xml:id attribute

Post by adrian_sorop »

Hi,
Currently, I can think of two built-in XML Refactoring operations that are able to change the value of xml:id attribute.
The operations are generic, but you can configure them for specific tasks.
The operations are:
1) Add/Change attribute - https://www.oxygenxml.com/doc/versions/ ... yz_bgk_54b
2) Replace in attribute value - https://www.oxygenxml.com/doc/versions/ ... 11_cgk_54b

Let me know if you encounter any problems while running them.
Adrian S.
Adrian Sorop
<oXygen/> XML Editor
http://www.oxygenxml.com
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Refactor: change the value of an @xml:id attribute

Post by chrispitude »

There are perhaps some tricky aspects to keep in mind:
  • @id values do not need to be unique across files.
  • @id values do not need to be unique across topics, even when they are in the same file.
  • @id values can be used as a part of @keyref references.
Care must be taken to change only the references that are precisely to the element whose @id value is being changed.
Post Reply