[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.10 Alternate Definition Forms

There are several methods for supplying data values for templates.

`no definitions'
It is entirely possible to write a template that does not depend upon external definitions. Such a template would likely have an unvarying output, but be convenient nonetheless because of an external library of either AutoGen or Scheme functions, or both. This can be accommodated by providing the --override-tpl and --no-definitions options on the command line. See section 5. Invoking autogen.

`CGI'
AutoGen behaves as a CGI server if the definitions input is from stdin and the environment variable REQUEST_METHOD is defined and set to either "GET" or "POST", See section 6.2 AutoGen as a CGI server. Obviously, all the values are constrained to strings because there is no way to represent nested values.

`XML'
AutoGen comes with a program named, xml2ag. Its output can either be redirected to a file for later use, or the program can be used as an AutoGen wrapper. See section 8.6 Invoking xml2ag.

The introductory template example (see section 1.2 A Simple Example) can be rewritten in XML as follows:

 
<EXAMPLE  template="list.tpl">
<LIST list_element="alpha"
      list_info="some alpha stuff"/>
<LIST list_info="more beta stuff"
      list_element="beta"/>
<LIST list_element="omega"
      list_info="final omega stuff"/>
</EXAMPLE>

A more XML-normal form might look like this:

 
<EXAMPLE  template="list.tpl">
<LIST list_element="alpha">some alpha stuff</LIST>
<LIST list_element="beta" >more beta stuff</LIST>
<LIST list_element="omega">final omega stuff</LIST>
</EXAMPLE>
but you would have to change the template list_info references into text references.

`standard AutoGen definitions'
Of course. :-)



This document was generated by Bruce Korb on June 4, 2003 using texi2html

Viewable With Any Browser   AutoGen Home