programmatically add wrapping tags
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 3
- Joined: Fri Mar 31, 2023 3:18 pm
programmatically add wrapping tags
Hi, I want to replace this
with this
I've done this kind of thing with Python xml.etree.ElementTree, but is there a way to do it in Oxygen?
Maybe I can select Foo with this
is there a way to wrap it with another tag?
Thanks for reading!
Code: Select all
<entry namest="col1" nameend="col2"><para>Foo
Code: Select all
<entry namest="col1" nameend="col2"><para><emphasis role="bold">Foo</emphasis>
Maybe I can select Foo with this
Code: Select all
//entry[@namest='col1' and @nameend="col2"]/para/text()
Thanks for reading!
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: programmatically add wrapping tags
Hi,
Are you working with DocBook? Is it DocBook 4 or 5?
In the Oxygen main menu "Tools->XML Refactoring" dialog there is a "Wrap element content" action. You could probably use "*:entry[@namest='col1' and @nameend="col2"]/*:para" as the target element and wrap its contents with <emphasis>. Then we have another "Add/Change Attribute" refactoring action which you could use to set the role="bold" on the <emphasis>.
Or you can create your own XML refactoring operations based on XSLT:
https://www.oxygenxml.com/doc/versions/ ... tools.html
Regards,
Radu
Are you working with DocBook? Is it DocBook 4 or 5?
In the Oxygen main menu "Tools->XML Refactoring" dialog there is a "Wrap element content" action. You could probably use "*:entry[@namest='col1' and @nameend="col2"]/*:para" as the target element and wrap its contents with <emphasis>. Then we have another "Add/Change Attribute" refactoring action which you could use to set the role="bold" on the <emphasis>.
Or you can create your own XML refactoring operations based on XSLT:
https://www.oxygenxml.com/doc/versions/ ... tools.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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