Templates Overview

epcEdit uses templates for two purposes:

Templates and layout information

SGML and XML documents do not carry layout information; they focus on abstract markup and leave the appearance of the document to specialized layout instructions that accompany the document. Since epcEdit provides layout formatting capabilities, the information about the document layout has to be stored somewhere outside of the document.

epcEdit uses templates to store the layout information for documents that correspond to these templates. When a document is loaded into epcEdit, the list of available templates is searched for a template that matches the document. If such a template is found, the layout instructions are retreieved from the template and applied to the document.

If the layout of the document is changed by modifying the styles for the elements in the document, these changes are stored in the template for further use for this document (of other documents that correspond to the same template).

Templates and new documents

Most SGML/XML documents adhere to a Document Type Definition (DTD). When epcEdit is asked to create a new document, it needs to know about the DTD for which it should create a document.

Because normally more than one document is created for a given document type, epcEdit collects the information that it needs to create a new document in a template. When a new document should be created, epcEdit retrieves all necessary information from the template.

The benefit of this approach is that the required information has to be provided only once: After a template has been defined, it can be used to create any number of new documents for the given document type just by selecting the template from the list of available templates.

epcEdit comes with a number of pre-defined templates for some widely-used document types.You may, however, want to create new templates for other document types or for your customized DTDs.

epcEdit can create templates for new document by two methods:

The following examples will illutrate how a new template is created with the template wizard.