Here's some basic information about Fleming and how to use it. These instructions assume you have a working knowledge of XML and XSL.
Fleming is a small utility to transform multiple XML files against a single XSL stylesheet and save the results in a new format. By providing (1) the directory path of a directory of XML files, and (2) the path to an XSL stylesheet, Fleming will apply the stylesheet to each of the XML files, and save the result in (3) an output directory with a new file extension. This is most commonly used to generate HTML files from XML source content.
Fleming is an HTML application, which is a relatively obscure Microsoft technology. It's essentially a Web page that will open and run in an instance of Internet Explorer, but without the security restrictions normally associated with a Web page. Fleming is therefore written in HTML and VBScript.
No, Fleming is open-source and in the public domain. Do with it what you will, but credit would be appreciated.
Internet Explorer 5.x and Microsoft's XML parser 4.0. If you have one, you usually have the other.
At a bare minimum, here's what you need to do something with Fleming:
Open Fleming by double-clicking on the Fleming.hta file. The interface will open as pictured at right.
Enter the following information:
Field | Data |
---|---|
| The absolute file path to your directory of XML files. |
| The absolute path to the XSL stylesheet that will be used to transform the XML files specified above. |
| The absolute path to the directory where the result files should be placed. |
| The file extension that all the result files should possess. You can enter this with or without the dot (e.g. -- "html" or ".html"). |
Press Transform. Here's what's happening:
Value Meaning Seconds The number of seconds from the start to end of processing. Total Files The total number of files found in XML Data: Directory. XML Files The number of XML files transformed. Error Files The number of files for which Microsoft's XML parser returned an error during the transform. Specific details about these errors can be found in the Activity Log, if logging has been enabled.
If you want more information about what Fleming is doing, you can click the Log Activity checkbox which will keep a running record of each batch run in the Activity Log. However, be warned that this will severely handicap performance for any batch of more than a few dozen files.
If you complete the Index Page section before pressing Transform, Fleming will add the contents of all the XML files it transforms to a single XML string. You can then specify a stylesheet to transform this aggregate XML string to generate an index page.
As they are transformed, Fleming adds the contents of the XML files to a string, in this format:
<fleming_index>
<fleming_file href="[URL to the result file]">
[entire XML contents of the file]
</fleming_file>
</fleming_index>
When Fleming is finished processing all the files, it will transform this XML string against the stylesheet specified in Index Page: Stylesheet. It will name the resulting file with the name specified in Index Page: File Name and the Results: Extension.
Using this feature, you can generate an entire directory of HTML files and a menu page with titles, links, summaries, etc. to those HTML files. When developing the stylesheet for the index page, you have the entire contents of the XML files to work with, so you can pull any information out of them, sort them by whatever field you choose, etc. This feature essentially rolls all the individual XML files up into one large file which can be used to organize the individual XML files.
See the sample XSL file at /SampleData/BondMovies/XSL/Index.xsl for more information.
Saved configurations are stored in /bin/Config.xml. Simply add all your commonly-used configurations to this XML document (duplicate the sample data structure), and they will be accessible in the Saved Configurations section at the bottom of the Fleming window. Click on the hyperlinked name of the configuration, and Fleming will fill in the necessary fields. (The View Saved Configurations link under the Transform button just scrolls the saved configurations into view.)
Turn logging off. The contents of the Activity Log are stored as a string, and as the job continues, this string gets longer and longer as more information gets appended to it. Due to a limitation in how VBScript handles string concatenation, this will destroy performance for anything more than a few dozen files. The Activity Log is for debugging or small jobs only and shouldn't be used on larger batch jobs.
Fleming is not meant to do large scale XSL transforms. Fleming will transform several dozen files in a few seconds. On the other end of the scale, on a 1-GHz test machine, Fleming transformed 5,000 XML files in about 15 minutes with logging turned off. (This is key. When logging is turned on, the program ground to a halt after a few hundred files.) Like most Windows apps, Fleming will use as much of the CPU as it can, so CPU utilization will spike to 99 or 100% while Fleming is running. Memory usage is high at first, but settles down and decreases as the batch job continues. In Windows Task Manager, HTML Applications run under the process image name "mshta.exe".
There's a saved configuration that will transform a set of XML documents describing all the James Bond films. Click the "The Bond Movies" under Saved Configurations and press Transform. You can find the results in /SampleData/Transformed.
NO. It's stable, but use it at your own risk.
Because I like James Bond.
Deane Barker
deane@deanebarker.net
http://www.deanebarker.net