We will now generate a documentation for each class of the UML model. First we add a title for a second chapter:
[#parameters]in model : uml21[/#parameters]
[#file]result.xml[/#file]
Introduction
This document is generated using MDWorkbench.
[#comment]This is a comment, not part of the output[/#comment]
Classes
Now we will use a foreach tag to iterate on classes:
Now we will use a foreach tag to iterate on classes:
class in model.getInstances("Class")"
(apply the style MDW_Expression).
[#parameters]in model : uml21[/#parameters]
[#file]result.xml[/#file]
Introduction
This document is generated using MDWorkbench.
[#comment]This is a comment, not part of the output[/#comment]
Classes
[#foreach class in model.getInstances("Class")]
Class
${class.name}
[/#foreach]
Here we ask for instances of type "Class" in the UML model, and we iterate on these classes using a variable class.
The print tag is used to evaluate an expression and to print the result in the document. Here we insert in the document the name of the class. The style used inside the print tag is essential: this is the style used to print the result of the evaluated expression. Here we use Heading 2.