Page 1 of 1

Refactoring: add prefix/QName

Posted: Wed Feb 17, 2021 3:08 pm
by UrbanHotbed
Hi all,

I currently have to import a large set of XML data into a mixed-namespace environment, thus using namespace prefixes is mandatory.

Unfortunately the authors of the input file obviously assumed authoring standalone information and thus simply implemented their own namespace as default.

Yes, I’m aware I could write an XSLT to do the job…

Though: Is there a built-in functionality with XML Editor that might do the job of assigning a prefix to elements and/or attributes which have none yet ?

Any hint is welocm !!

Best,
Bardo

Re: Refactoring: add prefix/QName

Posted: Thu Feb 18, 2021 9:01 am
by Radu
Hi,

If you open the XML document in Oxygen in the Text editing mode you can right click inside the root element tag name and choose "Refactoring->Rename prefix". You will have a choice to rename the prefix only on that element or on all elements in the document.

Regards,
Radu

Re: Refactoring: add prefix/QName

Posted: Thu Feb 18, 2021 5:38 pm
by UrbanHotbed
Really cool.

Takes its time, but works. :-)

Re: Refactoring: add prefix/QName

Posted: Thu Feb 18, 2021 6:15 pm
by Radu
Hi,

I'm glad this works for you, I added an internal issue to look into making the action faster on large XML docs.

Regards,
Radu