changing only one element within an XML document

Oxygen general issues.
Geoff16W
Posts: 8
Joined: Fri Mar 04, 2011 3:28 pm

changing only one element within an XML document

Post by Geoff16W »

I need some oxygenxml 101 help.

I have a XML document with a one element that I want to change (while the content within that element stays the same), but I don't want to have to write a separate XSLT sheet just to transform one element.

So suppose I have a <p></p> element. Can you please explain to me how I can use Oxygen to change all <p></p> to <h></h>, again while the content remains the same?

Can I do this in the simple find and replace function? If so can you explain how?

Thank you very much,
jw
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: changing only one element within an XML document

Post by adrian »

Hello,

You could use the Find/Replace to do this but you would have to check too many options to achieve this("Whole word only", "Enable XML Search options", Search only in "Element names").

It's a lot simpler to use the specialized Rename Element action:
- In the editor right click on the element name and from the popup/contextual menu choose Refactoring -> Rename Element(Alt+Shift+R)
- In the Rename dialog specify the new name(e.g. 'h') and choose the scope of the rename: the current element, the element and its siblings or all the elements with that name(you'll probably want this last one).

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Geoff16W
Posts: 8
Joined: Fri Mar 04, 2011 3:28 pm

Re: changing only one element within an XML document

Post by Geoff16W »

Very helpful, Adrian, Thanks so much.
Post Reply