How-To define your own File-type
XML:Wrench comes with a number of pre-defined file-types, including XML, HTML, CSS, XSL, XSD, RSS and plain text. You may want to add your own. There are two common reasons for this. First you may wish to add a file-type to cover a standard file format that isn't supplied with XML:Wrench. Alternatively you might have your own file-type, for example an in-house XML format, that you wish to be able to create/edit using XML:Wrench.
To define a new file-type click on the 'Edit' menu and then select 'Configuration options...'. A dialog will be displayed with three separate tabbed pages; select the third page 'File-types'.
Click on the Add button. You can then set most options in the same way as described earlier. There are a couple more options that you might want to setup.
Help files
You can add your own context-sensitive help file to your newly defined file-type. Create an HTML help file and add it to the folder that holds your file-type configuration. This might typically be: C:\Program Files\xmlwrench\help\newfiletype\
You then need to tell XML:Wrench the name of your help file. See: How-to configure a file-type.
ADVANCED USERS ONLY: You can create any web page you like and use it as the help file for your new file-type. However you may want to create a help file with the same general appearance as XML:Wrench's own files. You may also want to include example code that can be pasted in as with the standard help files.
To help with this, we include a sample project. This includes all our help files in XML together with style-sheets for generating the actual help files.
As a general rule, our help files have the following format. The first section describes what the file format is, and what standards if any, are covered by the help file.
This is then followeed by a nubmer of sections, each referring to a specific keyword or topic for that file format. These are usually done in order, starting with the most general or top-level topics at the beginning.
The final topic details the souce of information on the web.
Installing a new file-type automatically
ADVANCED USERS ONLY: XML:Wrench is designed so that new file-types can be added automatically by other programs. This has bee ndoe so thatsome file-types could be supplied as optional downloads.
There is however no reason why end users shouldn't also use this when creating new file-types.
If you want to add a file-type to XML:Wrench automatically, then you need to do the following. You need to copy the entire file-type folder that you have created to the user's machine. For example if you created a new file type called 'foo', you will have a folder on your machine say %xmlwrench%\help\foo where %xmlwrench% is the lcoation of the main XML:Wrench program (e.g. C:\Program Files\xmlwrench). This folder will contain a config file, a help file maybe some other supporting files and a folder called blanks with exmaple blank/template files.
You will have to arrange for this to be copied to the equivalent place on the user's system. If you do this with an install program there are a couple of checks you ought to make. First, either ask the user where they installed XML:Wrench or obtain this from the registry. Secondly, to make sure that you don't overwrite any existing files, either prompt the user before installing, or backup any replaced files first.