Multi-line Find/Replace across a directory structure?
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 6
- Joined: Mon Nov 10, 2008 9:55 am
Multi-line Find/Replace across a directory structure?
I have a bunch of files in a directory structure that have an invalid DTD declaration and some proprietary junk that I want to delete. So now I want to work with them in oXygen and use the standard DITA-OT DTD.
Is there a method for me, in Oxygen, to replace the multiple lines that these files all have in their headers, with the simple simple declaration of:
So, in other words, for "Find," can I put the multiple lines that are in the topics now (something like 15 lines), and have it replace those lines with
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
"../../../frameworks/dita/DITA-OT/dtd/task.dtd">
...and then do this operation recursively through a directory structure?
I had a script to do this but it wasn't entirely successful so now I am hoping there is an easy way to do this in the oXygen interface or with another tool that comes with oXygen.
Thanks,
John
Is there a method for me, in Oxygen, to replace the multiple lines that these files all have in their headers, with the simple simple declaration of:
So, in other words, for "Find," can I put the multiple lines that are in the topics now (something like 15 lines), and have it replace those lines with
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
"../../../frameworks/dita/DITA-OT/dtd/task.dtd">
...and then do this operation recursively through a directory structure?
I had a script to do this but it wasn't entirely successful so now I am hoping there is an easy way to do this in the oXygen interface or with another tool that comes with oXygen.
Thanks,
John
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Multi-line Find/Replace across a directory structure?
Post by sorin_ristache »
Hello,
Oxygen has a dialog for search and replace in multiple files but the text that will be replaced must be on a single line. I suggest doing one find/replace action on all the XML files for each line that you want to change in the files.
You can replace the lines with a new DTD declaration or you can replace the lines with a blank line which only removes the old declarations. If there is no schema declaration in the XML files Oxygen tries to match the document with one of the document types defined in the Preferences. In your case the XML documents can be associated with one of the predefined document types for DITA XML documents or with a new document type that you create from menu Options -> Preferences -> Document Type Association.
Regards,
Sorin
Oxygen has a dialog for search and replace in multiple files but the text that will be replaced must be on a single line. I suggest doing one find/replace action on all the XML files for each line that you want to change in the files.
You can replace the lines with a new DTD declaration or you can replace the lines with a blank line which only removes the old declarations. If there is no schema declaration in the XML files Oxygen tries to match the document with one of the document types defined in the Preferences. In your case the XML documents can be associated with one of the predefined document types for DITA XML documents or with a new document type that you create from menu Options -> Preferences -> Document Type Association.
Regards,
Sorin
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