|
next
|
 Subject: Re: Wrapped in the middle XML elements (not well-formed XML) Author: (Deleted User) Date: 08 Jul 2004 06:28 PM
|
Hi Yitzhak,
unfortunately building a macro functionality powerful enough to perform the
kind of text manipulation you ask is not a simple task, and would require a
lot of effort on our side.
So I am suggesting you this workaround:
1) download and install, if you don't have it already, ActivePerl 5.6 (you
can download it for free from http://www.activestate.com)
2) inside Stylus Studio, go to Tools | Options | Custom Tools
3) add a new tool by clicking on the button in the top right corner, and
name the tool (e.g. "Fix broken XML")
4) click on the "Browse" button next to the "Command" edit box and search
for the perl.exe executable (e.g. "C:\Perl\bin\perl.exe")
5) save the cmd.txt file attached to this message into a folder of your choice
6) in the "Arguments" edit box enter "-pi.bak c:\cmd.txt ${FilePath}"
(replace the c:\cmd.txt with the path and name of the file saved at step 5)
(for the record, it means that it will process the active document using
the instructions found in the cmd.txt file, and making a backup copy having
the .bak extension)
7) click OK
At this point, you can load the XML file inside Stylus and select Tools |
Fix broken XML; after the script runs, you will need to press alt-tab to
switch the focus away from Stylus and then press it again to get back to
Stylus. This way Stylus will check for any modification occurred to the
open files, and prompt you if he should reload it.
Clearly you can also run the perl script from a command line to perform
batch operations.
Alberto
cmd.txt
|
|
|