Circuit XML Grammar

(Reprinted and modified with permission from "Discovering Fusebox 4, Second Edition" by John Quarto-vonTividar)

Overview

Fusebox 4/5 includes an XML-based language with its own grammar. Fortunately for those of us who preferred Algebra to English in school, the Fusebox grammar is exceedingly simple, containing only what might best be described as "verbs"—and only five verbs at that—plus a smattering of attributes and helper constructs. Therefore, this will be a short, albeit absolutely critical, chapter towards mastering Fusebox.

This grammar is used in an application's fusebox.xml file and circuit.xml file for each circuit in the application. Thus, these commands can occur inside the fusebox.xml's globalfuseaction element, or within a circuit.xml's fuseaction, prefuseaction or postfuseaction elements and no where else.

By restricting the size of the available grammar and its use within the above-mentioned files' elements, the developer will more correctly keep program logic where it belongs—in fuses rather than in fuseactions.

By specifying the application architecture in XML, we have a cross-platform standardized mechanism for creating language-independent Fusebox applications. That is to say, if you now complete a Fusebox project in, say, ColdFusion, then porting your application to PHP consists only of translating the application's fuses into PHP and dropping in a set of Fusebox compliant PHP core files. That portability translates into increased development speed and longevity, leveraging of existing code bases, project flexibility, and higher return on investment for commercial software development using Fusebox.

The Builtin Verbs

Summary

This has summarized the Fusebox grammar, consisting of five "verbs" (include, set, xfa, do, relocate) and two "helper constructs" (if and loop). Armed with this small but flexible grammar you are now ready to build powerful Fusebox applications that are modular, language-independent, and highly maintainable.