|
FleXML - XML Processor Generator
FleXML reads a DTD (Document Type Definition) describing the format of XML (Extensible Markup Language) documents; it may be specified as a URI to the DTD on the web. From this FleXML produces a validating XML processor with an interface to support XML applications. Proper applications can be generated optionally from special action files, either for linking or textual combination with the processor. FleXML is specifically developed for XML applications where a fixed data format suffices in the sense that a single DTD is used without individual extensions for a large number of documents. (Specifically it restricts XML rule [28] to [28r] doctypedecl ::= ' where the ExternalId denotes the used DTD - one might say, in fact, that FleXML implements ``non-extensible'' markup. :) With this restriction we can do much better because the possible tags and attributes are static: FleXML-generated XML processors read the XML document character by character and can immediately dispatch the actions associated with each element (or reject the document as invalid). Technically this is done by using the Flex scanner generator to produce a deterministic finite automaton with an element context stack for the DTD, which means that there is almost no overhead for XML processing. Furthermore we have devised a simple extension of the C programming language that facilitates the writing of `element actions' in C, making it easy to write really fast XML applications. In particular we represent XML attribute values efficiently in C when this is possible, thus avoiding the otherwise ubiquitous conversions between strings and data values. Compared to SAX and its XSL-based friends, FleXML immediately produces efficient code in that the interdiction of extension makes it possible to encode efficiently, FleXML for example uses native C `enum' types to implement enumeration attribute types. However, the above limitation does prevent uses in more complex settings.
As an example: the following is all that is needed to produce a
fast program that prints all href-attributes in
In general, action files are themselves XML documents conforming to the DTD
with
The program is freely redistributable and modifiable (under GNU `copyleft'). Copyright © Kristoffer Rose. Last modified: Thu Aug 30 15:42:09 MDT 2001 |
$Id: FleXML.html,v 1.3 2001/08/31 03:28:11 shack Exp $