15. An apparatus, comprising: at least one processor and a memory coupled to the at least one processor, in which the at least one processor is configured: to execute a dynamic document template having access only to variables in its local namespace and variables passed by an application through arguments to the dynamic document template, wherein the dynamic document template is physically separate from the application, in which the step to execute the dynamic document template comprises the step to call separate dynamic document template scripts which comprise the dynamic document template from more than one application program, in which the step to call the dynamic document template comprises the step to generate an interim script, and in which the method further comprises code to delete the interim script after the document is generated; to generate a script from the dynamic document template; and to create a document based, in part, on the script by executing procedural statements of the script to generate document records, wherein the document comprises document records without the procedural statements.
15. An apparatus, comprising: at least one processor and a memory coupled to the at least one processor, in which the at least one processor is configured: to execute a dynamic document template having access only to variables in its local namespace and variables passed by an application through arguments to the dynamic document template, wherein the dynamic document template is physically separate from the application, in which the step to execute the dynamic document template comprises the step to call separate dynamic document template scripts which comprise the dynamic document template from more than one application program, in which the step to call the dynamic document template comprises the step to generate an interim script, and in which the method further comprises code to delete the interim script after the document is generated; to generate a script from the dynamic document template; and to create a document based, in part, on the script by executing procedural statements of the script to generate document records, wherein the document comprises document records without the procedural statements. 17. The apparatus of claim 15 , in which the at least one processor is further configured to compile the script after generating the script.