Page 1 of 1

deleting alll elements (and contents) of a certain type

Posted: Sun May 15, 2011 1:36 am
by Geoff16W
I feel like there is an easy a solution to this question, but after lots of frustration I thought I should just ask.

Basically, I want to select all "index" elements and then delete them.

I am able to "find" all elements of certain types and their contents using the Find->find elements/attributes. However, I want to delete all of these at once. But I can't. Am I missing something?

Then I tried to do this with a regular find and replace. But I don't seem to able able "find" the entirely of the element i.e. <index>.. content. </index>

I'm grateful for any help you can give me.

Re: deleting alll elements (and contents) of a certain type

Posted: Mon May 16, 2011 11:25 am
by adrian
Hello,

To delete all the elements of a certain name and their content you can use the Find/Replace dialog with XPath:

1. Find -> Find/Replace
2. Text to find: .*
3. Replace with: <leave empty>
4. XPath: //index
5. Enable Regular expression and Dot matches all
6. Press Find all to check that it finds what you want to remove.
7. Press "Replace all" to remove the content.

Regards,
Adrian