Global unwrapping
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 43
- Joined: Mon Oct 01, 2018 7:29 pm
Global unwrapping
Post by david_himself »
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
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Global unwrapping
Hello David,
In the Oxygen main menu Tools->"XML Refactor" you will find an "Unwrap element" action, it can work over multiple files and you need to pass to it an XPath for the element to unwrap, for example maybe in your case "//*:body//*:seg".
Regards,
Radu
In the Oxygen main menu Tools->"XML Refactor" you will find an "Unwrap element" action, it can work over multiple files and you need to pass to it an XPath for the element to unwrap, for example maybe in your case "//*:body//*:seg".
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 43
- Joined: Mon Oct 01, 2018 7:29 pm
Re: Global unwrapping
Post by david_himself »
Thanks, Radu. I had already experimentally tried Refactoring in the Document menu of a single file, but the operation was unavailable there. It looks as if it will be available in the right-click menu for the project or the file folder. I will cautiously have a go. Many thanks for prompt reply.
best
David
best
David
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service