The examples for tools all describe compilers, but I'm actually using an xslt transform on an xml file.
I have the Microsoft msxsl engine set up as a tool.
If I provide the output parameter and filename, the resulting transformation is saved as a file.
If I omit it, the resulting transformation shows up in the Command Results window. In that case, I need to save the file manually.
What I'd like to do is provide a filename and have the file created and saved for me, but I'd like TextPad to open that file in a new window so I can look at it.
Is there any way to do this?
Thanks,
Roger Sperberg
"compile" and open resulting file?
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
- talleyrand
- Posts: 624
- Joined: Mon Jul 21, 2003 6:56 pm
- Location: Kansas City, MO, USA
- Contact:
Error messages?
I won't be able to try this out for a while. Thanks for the suggestion.
I wonder what will happen if there's an error in the transformation -- will it be delivered to the Command Results window do you think?
When I provide the -o filename parameter, saving the transformation into a file, errors do show up in Command Results, which obviously is helpful.
Thanks again,
Roger
I wonder what will happen if there's an error in the transformation -- will it be delivered to the Command Results window do you think?
When I provide the -o filename parameter, saving the transformation into a file, errors do show up in Command Results, which obviously is helpful.
Thanks again,
Roger
Got it to work
Thanks for this guidance. You got me to the desired result.
I put the batch file in c:\programs, which I like to use for TextPad tools because it eliminates the issue of having a space in a directory name.
Then I found I couldn't call TextPad from the batch file because cmd.exe didn't like the space in the folder name. I'm sure there's some way to use spaces, but to get it to work I just made the batch file read like this:
The batch file sent back information to the Command Results window when things went well and TextPad opened the results file and made it the active window.
When I ran it with a non-well-formed XML file, the Command Results window display showed the error from the XSL engine and double-clicking on the file error line jumped me properly back to the source XML file.
(As noted in a different thread, I cannot get the Line and Column to work with this multi-line error message. Don't know if it's the regex or TextPad that's accountable.)
Roger
I put the batch file in c:\programs, which I like to use for TextPad tools because it eliminates the issue of having a space in a directory name.
Then I found I couldn't call TextPad from the batch file because cmd.exe didn't like the space in the folder name. I'm sure there's some way to use spaces, but to get it to work I just made the batch file read like this:
I set up the tool as a DOS command with these settings:c:\programs\msxsl.exe %1 %2 %3 %4
c:\Progra~1\TextPa~1\TextPad.exe %4
(The stylesheet name is hardwired into this, but of course that can be specified in the XML file being transformed.)Parameters: c:\programs\msxsl-transform.bat $Filename my-stylesheet-name.xsl -o $Basename.xtmm
Initial folder: $FileDir
Regular expression to match output:
^(URL: file:///)([A-Z]:.+)\/(.+)\nLine:( *)([0-9]+)\nColumn: ([0-9]+)$
Registers:
File: 3 Line: 5 Column: 6
The batch file sent back information to the Command Results window when things went well and TextPad opened the results file and made it the active window.
When I ran it with a non-well-formed XML file, the Command Results window display showed the error from the XSL engine and double-clicking on the file error line jumped me properly back to the source XML file.
(As noted in a different thread, I cannot get the Line and Column to work with this multi-line error message. Don't know if it's the regex or TextPad that's accountable.)
Roger