Fleming Help and Instructions

Here's some basic information about Fleming and how to use it.  These instructions assume you have a working knowledge of XML and XSL.

What does Fleming do?

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.

What type of program is Fleming?

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.

Does Fleming cost anything?

No, Fleming is open-source and in the public domain.  Do with it what you will, but credit would be appreciated.

What do I need to run Fleming?

Internet Explorer 5.x and Microsoft's XML parser 4.0.  If you have one, you usually have the other.

How do I run Fleming?

At a bare minimum, here's what you need to do something with Fleming:

  1. A directory of XML files.  There can be however many files as you like in the directory.
  2. An XSL stylesheet.  This stylesheet will be applied to each and every XML file in the directory specified above.  The result will be output in a file.  This file will share the same root name of the XML source file, but will have a different extension (specified below).
  3. An output directory.  This is where all the result files will be placed.  Any files in this directory with the same name as a new, incoming file will be over-written.
  4. A file extension.  This is the extension that will be placed on the result files.

Open Fleming by double-clicking on the Fleming.hta file.  The interface will open as pictured at right.

Enter the following information:

Field Data
XML Data: Directory The absolute file path to your directory of XML files.
XML Data: Stylesheet The absolute path to the XSL stylesheet that will be used to transform the XML files specified above.
Results: Directory The absolute path to the directory where the result files should be placed.
Results: Extension 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:

  1. Fleming will open the XML Data: Directory and begin looping through all the files it finds.
  2. If the file has an XML extension, Fleming will transform it against the stylesheet found at XML Data: Stylesheet.  If the file isn't an XML file, Fleming will skip it and move to the next file.
  3. Fleming will write the text resulting from the XSL transform to a file in Results: Directory using (1) the base name of the original XML file (without any extension), and (2) the file extension found in Results: Extension.  If a file with this name already exists in Results: Directory, Fleming will overwrite the file.
  4. When finished with all the files in XML Data: Directory, Fleming will display a summary in the Summary of Last Run section.  This information is as follows:
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.

How can I get Fleming to write an index or menu file of all my XML 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.

How do I save input so I don't have to type it in again every time I want to do a transform?

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.)

Fleming gets slower and slower as the batch job continues. Why?

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.

How scalable is Fleming?

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".

How can I try Fleming out?

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.

Does Fleming come with a warranty?

NO. It's stable, but use it at your own risk.

Why is it called Fleming?

Because I like James Bond.

Who wrote Fleming?

Deane Barker
deane@deanebarker.net
http://www.deanebarker.net