Hello,
I've got a big XML file I'm editing with BBEdit.
Within the XML file, which is a digital recreation of an old diary, is text that is enclosed in note tags.
<note>Example of a note.</note>
Some note tags, however, have quotations enclosed in quote tags nested in them.
<note>Example of a note, but <quote>"here is a quotation within the note"</quote></note>
I need to remove all instances of quote from the note tags, whilst keeping the actual content of the quote tags. So the example would become:
<note>Example of a note, but "here is a quotation within the note"</note>
I've used GREP in BBEdit to successfully remove some of these, but I'm beginning to get stuck with the more complicated note tags that go over several lines or have text between the two different sets of tags. For example:
<note>Example of a note, <quote>"with a quotation"</quote> and a <quote>"second quotation"</quote> along with some text outside of the quotation before the end of the note.</note>
Some quotations can go on for over 10 lines. Using \r in my regex doesn't seem to help.
I should also say that quote tags can exist outside of note tags, which rules out the possibility of just bulk finding /?quote and deleting it. I still need to use the quote tags within the document, just not within note tags.
Many thanks for any help.