How to Find/Replace an XML tag

Oxygen general issues.
bdmossma
Posts: 1
Joined: Wed Aug 29, 2012 9:34 pm

How to Find/Replace an XML tag

Post by bdmossma »

How do you Find/Replace an XML tag as follows:
Text to Find: <root>
Replace with: <Module>
Note: Module is inside the root XML block. And we want to replace "root" with actual content of <Module>some content</Module>.
Is some special expression needed?
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: How to Find/Replace an XML tag

Post by adrian »

Hi,

I'm not sure exactly what you want to achieve.

If you just want to rename the root element to Module, you could right click in the root element use the action from the contextual menu: Refactoring > Rename element then type Module in the New name field.

You can also achieve the same with the Find/Replace dialog but this is at text level so you have to be careful to avoid accidental matches:
Text to Find: root
Replace with: Module
Options: Whole words only
Enable XML search options
Search only in
Element names (the others should be disabled)

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply