Hi everyone,
trying to wrap my head around grep to accomplish this: i have several very large XML docs and need to remove some tags from them (just the tags and attributes, not the content inside the tags). There is just too much to do this manually so i'm wondering if this is possible with BBedit.
Within the document i have these kind of elements:
<structured-content content-type="task" vocab="work" vocab-term="main" id="id-c416e7d8-cd3d-4c85-bb5a-d5496d0aa54a">Some text content here</structured-content>
sometimes there can be one or several other elements inside these elements like for example:
<structured-content content-type="task" vocab="work" vocab-term="main" id="id-c416e7d8-cd3d-4c85-bb5a-d5496d0aa54a">Some <xref ref-type="ctrl" rid="id-a1847df5-8e01-21d8-f1d1-88b03728498b">text content</xref> here.</structured-content>
So i need to remove the <structured-content> tags entirely but preserve the content and tags WITHIN these elements, is this at all possible with grep in bbedit ?
Note that the code above is just a very simple example to illustrate, it
gets much more
complicated than that with tables, mathml, figures etc inside the tags
to be removes ... there isn't a repetitive pattern to the content that
can be inside the tags to be stripped, it could be anything so i want to
be sure that i don't delete anything else than the enclosing tag.
I'm working my way through tutorials and examples but have a long way to go to figure this out on my own, so maybe one of you has a way to do this ?
many thx in advance for your help.