I find it easiest to put programs that I call from within TextPad in a folder directly off the root that contains no spaces in the name. So, for instance, you might install RXP in:
C:/programs/rxp.exe
(or C:/programs/rxp/rxp.exe or whatever)
I set up two tools in TextPad, one to check well-formedness and one to validate the XML. Each tool calls RXP; only the parameters supplied are different.
In TextPad, you will need to create a new tool (I won't repeat the basics here). I call my first tool "Well-formed check".
The settings in Preferences should be:
(Obviously the command line should match the exact path to where you placed the RXP executable. You can fiddle with the parameters too, of course.)Command: C:\programs\rxp.exe
Parameters: -avsN $Filename
Initial folder: $FileDir
Check "Capture output" (and other options you may prefer, such as "Save all documents first")
The regular expression that works for me ("Use POSIX regular expression syntax" is checked in Preferences/Editor) is this:
With the XML file open in the active window, simply invoke your "Well-formed check" tool.Regular expression to match output
^.+line ([0-9]+) char ([0-9]+) of file:///([A-Z]:.+)$
Registers:
File: 3 Line: 1 Column: 2
These settings cause RXP to check that the XML file is well-formed and report in the Command Results window.
The second tool, called "XML validation", is a near duplicate of "Well-formed check". The only difference is that the Parameters line has slightly different settings -- "-avVNs $Filename". With these settings, RXP validates the XML file against the DTD identified in the document type declaration.
If there is a problem in the file, you should be able to double-click on the line specifying the error to have TextPad automatically jump you to the right spot in your file.
Roger Sperberg
Thanks to Wendell Piez of Mulberry Technology for first pointing me to RXP and how to use it with TextPad.