FanXE - The Fantastic XML Editor
                             by Tom Allard

ABSTRACT

    FanXE is an XML editor written in [incr Tcl]/Tk using the tdom and
    Tkhtml.  A developer builds XSLT style sheets that transform nodes
    in the DOM into HTML forms editable in the GUI.  When the form is
    submitted, the DOM node is rebuilt.

    FanXE can maintain XML documents under RCS revision control or
    within a PostgreSQL database.  The base class is easily extensible
    as demonstrated with 3 subclasses.

    FanXE can act as a command-line XSLT engine and includes XSLT
    extensions that allow style sheets to execute Tcl commands in a safe
    interpreter.


SUMMARY

    On my first foray into XML, I needed a highly customizable GUI for
    editing XML documents.  This included choosing which nodes are
    displayed to the end user and the ability to edit nodes and their
    children in a single form.  The end-user must not be required
    to know anything about XML.  Experienced users should be able
    to view the underlying XML and use XPath expressions to search
    the documents.  Developers should be capable of writing FanXE
    applications with limited or no Tcl experience (extensive XML/XSLT
    knowledge, however, are required for developers).

    It was also important for this editor to be the face of different
    applications and therefore it had to be easily extensible.  The
    "front page" can be either a static HTML page or dynamically
    generated HTML from a method inside the class.  Links in the HTML
    can be either XPath expressions to nodes in the DOMs, links to
    methods in the class, or just regular web links.

    The paper will cover why certain Tcl/Tk extensions were chosen:

	      GOOD			      BAD

	tdom
	    * Fastest XSLT engine.	    * Lack of W3C Schema Language
					      validation.
	    * Good memory footprint.
	    * Excellent support/helpful
	      maintainers.
	Tkhtml
	    * Fast			    * Lacks CSS support.
	    * Excellent support for nested  * Lack of ongoing support.
	      tables.
	Tix
	    * Personal familiarity.	    * Lack of ongoing support.
	    * Excellent tree widget
	      performance.
	BLT
	    * Detachable tabs.


    The paper will cover the basic features of the editor as well as the
    innovations used in several sub-classes.  The main classes covered
    are:

	I. ItemSet	--  An application to create a timeseries micro and
			    macro database of commercial bank financial
			    data.

	    * Motivating factor behind basic FanXE design.
	    * Reasonably large, cross-referenced DOMs.
	    * XML documents must be maintained in RCS.
	    * Change-reporting across RCS revisions is critical.

	II. BCBreaks	--  An application for maintaining and applying
			    adjustments to macro timeseries data.

	    * Nodes are stored in PostgreSQL.
	    * Multiple users need to simultaneously edit different
	      nodes in the XML document.

	III. SDMX	--  This application is used by content providers 
                            inexperienced with XML to build the complex
                            SDMX XML files.  SDMX is the Statistical
                            Data and Metadata Exchange, a new ISO
                            standard for exchanging timeseries data
                            across agencies.

	    * Added DOM "cloning" where a user can create a new XML
              document using the rules and stylesheets built for another
              XML document.
	    * The "help" page is dynamically generated based on XML
              documents loaded into memory.  This allows users to create
              schema files or build datasets based on the files they
              have loaded.