file

Syntax

[#file]filename expression[/#file]

where:

Description

The file tag defines the name of the file where the text generated by a doc template will be written. The content of this tag can contain expressions that will be evaluated at runtime.

The output file extension must be .xml or .docx, so that Microsoft WordŽ is able to load the file, or .odt, so that any Open Document compliant authoring tool is able to load the file.

It is recommended to use a relative path here (e.g. myFolder\myFile.xml). A relative path will be resolved at runtime to an absolute path (e.g. c:\myProject\generated\myFolder\myFile.xml) using a default evaluation directory, which can be configured by the end-user of the generator. If you specify an absolute path in this tag contents, the generation will be less configurable and flexible.

Although it may appear anywhere inside a doc template body, it is a good practice for reader's convenience to put the file tag right after the parameters tag.

The encoding used to create the output file is fixed to UTF-8.

Examples

This will generate a simple Documentation:

[#parameters]in model : uml21[/#parameters]
[#file]generated/output.xml[/#file]
UML model documentation
[#foreach class in model.getInstances("Class")]
    Class: ${class.name}
[/#foreach]

This will generate a simple documentation, based on a UML package name:

[#parameters]package : uml21.Package[/#parameters]
[#file]Documentation_[#expr]package.name[/#expr].xml[/#file]
Package: ${package.name}
...