Batch search & replace
Post here questions and problems related to editing and publishing DITA content.
Batch search & replace
Hi!
Is there a way to make batch search and replace actions, based on a txt or other input file, on a complete DITA map hierarchy? I already found the powerful search/replace tool over a DITA hierarchy, but it can only do one search at a time, and I would have hundreds to do in my conversion process...
Perhaps there is another way using refactoring or XSLT methods...
Basically I would like to convert
into
for hundreds of terms, over all my DITA map hierarchy.
Thanks for the help!
David
Is there a way to make batch search and replace actions, based on a txt or other input file, on a complete DITA map hierarchy? I already found the powerful search/replace tool over a DITA hierarchy, but it can only do one search at a time, and I would have hundreds to do in my conversion process...
Perhaps there is another way using refactoring or XSLT methods...
Basically I would like to convert
Code: Select all
<term id="PLEM">PLEM</term>
<term id="FLET">FLET</term>
<term id="PLET">PLET</term>
...
Code: Select all
<abbreviated-form keyref="PLEM"/>
<abbreviated-form keyref="FLET"/>
<abbreviated-form keyref="PLET"/>
...
Thanks for the help!
David
Re: Batch search & replace
Hi David,
Oxygen has support for XML refactoring based on applying a custom XQuery update or XSLT script:
https://www.oxygenxml.com/doc/versions/ ... tools.html
I created a sample XSLT refactor script based on what you described:
https://github.com/oxygenxml/dita-refac ... ated-forms
Basically if you have somewhere on your disk a folder containing the custom operation XML and XSLT documents, then in the Oxygen Preferences->"XML / XML Refactoring" page you point to that folder, then from the main "Tools" menu you can access the "XML Refactoring" action and it should contain a "Convert terms to abbreviated forms" action which can be applied on multiple files.
Regards,
Radu
Oxygen has support for XML refactoring based on applying a custom XQuery update or XSLT script:
https://www.oxygenxml.com/doc/versions/ ... tools.html
I created a sample XSLT refactor script based on what you described:
https://github.com/oxygenxml/dita-refac ... ated-forms
Basically if you have somewhere on your disk a folder containing the custom operation XML and XSLT documents, then in the Oxygen Preferences->"XML / XML Refactoring" page you point to that folder, then from the main "Tools" menu you can access the "XML Refactoring" action and it should contain a "Convert terms to abbreviated forms" action which can be applied on multiple files.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: Batch search & replace
Fantastic!
I should really go further into XSLT and try to do it myself! I cloned your example repository, and will probably find some more very useful stuff in there!
Thanks you made my day.
David
I should really go further into XSLT and try to do it myself! I cloned your example repository, and will probably find some more very useful stuff in there!
Thanks you made my day.
David
Return to “DITA (Editing and Publishing DITA Content)”
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