A Simple Example

part of a tutorial on the Dynamic Publishing System by Karl Goldstein

This lesson should give you basic familiarity with writing a template specification file and embedding dynamic content in a related template.

Create the specification file

A specification file is a simple XML document that uses a standard set of tags to describe the dynamic content presented by a template.

Create a file named hello.data in a test directory of your server and enter the following simple specification:

As this example shows, a template specification consists of some general properties followed by any number of data sources. Data sources may be query parameters, Tcl procedures, or database queries. In this case, the data source returns a single string. This is noted in the metadata by assigned a value of onevalue to the structure property.

Create the template

Once you have written the specification, you create a template that references the dynamic content provided by this specification. You and other members of your team can review variable names and descriptions in the online data dictionary generated from the specification file. The data dictionary is accessed from a web browser via the URL of the specification file (the file must end in the spec extension). It is primarily intended as a convenience to template authors.

View the data dictionary

View results

Tutorial Contents
karlg@arsdigita.com