Generate text document with doc composer

Like that?

Summaries:
use <Text>...</Text> to generate static text
use <Property property=... /> to generate text from your diagram or element
use <IterationBlock> to retrieve elements from your diagram
use <ForEachSubDiagram> to retrieve sub diagrams from your element

<?xml version="1.0" encoding="UTF-8"?>
<DiagramBaseInitiationBlock>
	
	<Text>Diagram: </Text><Property property="name"/>
	<ParagraphBreak/>
	
	<!-- check any Elements drawn in this diagram -->
	<IterationBlockConditionChecker>
		<Text>Elements: </Text>
		
		<!-- foreach the elements and print their name:modelType -->
		<IterationBlock ignoreLastSeparator="true">
			<Property property="name"/><Text>:</Text><Property property="modelType"/>
			<Text>, </Text>
		</IterationBlock>
		<ParagraphBreak/>
		
	</IterationBlockConditionChecker>
	
	<!-- check any Elements contains sub-diagram -->
	<IterationBlockConditionChecker>
		<Conditions>
			<HasSubDiagramChecker/>
		</Conditions>
		
		<Text>Sub Diagrams: </Text>
		
		<!-- foreach the elements, which has sub-diagrams -->
		<IterationBlock>
			<Conditions>
				<HasSubDiagramChecker/>
			</Conditions>
			
			<!-- foreach the sub-diagrams from an element, and print their name:diagramType -->
			<ForEachSubDiagram ignoreLastSeparator="true">
				<Property property="name"/><Text>:</Text><Property property="type"/>
				<Text>, </Text>
			</ForEachSubDiagram>
		</IterationBlock>
		<ParagraphBreak/>
		
	</IterationBlockConditionChecker>
	
</DiagramBaseInitiationBlock>
1 Like