epcEdit uses templates for two purposes:
Templates are used for creating new documents. A template acts as a protoype for new documents and provides epcEdit with the necessary information to initialize the document.
Templates associate a document with layout information. A template holds layout instructions that tell epcEdit how the document should be displayed on the screen.
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).
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:
By creating a template from scratch with the template wizard, or
By deriving a template from an existing document.
The following examples will illutrate how a new template is created with the template wizard.
![]() |