Global unwrapping
Posted: Tue Sep 21, 2021 12:47 pm
Hi
I want to remove the <seg> tags from every XML file in a project, but
(1) only in body, not teiHeader
(2) regardless of attributes and values
(3) leaving the enclosed material untouched
(4) not adding extra spaces
Were it not for condition (1), it would be easy with regex. Example. Change
my advice <seg type="bodySalute"><rs ref="psn:MH">my Friend</rs>,</seg> I give it you
to
my advice <rs ref="psn:MH">my Friend</rs>, I give it you
How? Thanks in advance.
best
David
I want to remove the <seg> tags from every XML file in a project, but
(1) only in body, not teiHeader
(2) regardless of attributes and values
(3) leaving the enclosed material untouched
(4) not adding extra spaces
Were it not for condition (1), it would be easy with regex. Example. Change
my advice <seg type="bodySalute"><rs ref="psn:MH">my Friend</rs>,</seg> I give it you
to
my advice <rs ref="psn:MH">my Friend</rs>, I give it you
How? Thanks in advance.
best
David