Reusing gendoc scripts inside the same document: <fragment> tag

If a script section is used several times in a same document template, tag <fragment> can be used to define the script section and its attributes.

It can then be called from <gendoc> tags inside the same template document

<fragment> tag can contain the following attributes:


<dropSlide/>
<fragment name=’displayDiagram’ importedBundles=’commons;gmf;papyrus’>
 <arg name=’element’ type=’uml::Element’/>

<dropSlide/>
[for (d:Diagram|element.getPapyrusDiagrams())]

Diagram [d.name/]:
<image object=’[d.getDiagram()/]’ maxH=’true’/>

 [/for]
<dropSlide/>
</fragment>
<dropSlide/>

<gendoc>
[for(p:Package|Package.allInstances())]
<dropSlide/>

[p.displayDiagram()/]

<dropSlide/>
  [/for]
</gendoc>