I am trying to create a report where I display the classes on a class diagram and the attributes associated to the class.
I am able to loop thru the classes but I can’t figure out how to loop thru the attributes of a class.
Any help would be appreciated.
Here’s the template I am using:
<?xml version="1.0" encoding="UTF-8"?>
<Template>
<TemplateInformationHeader default="false"
description="/" id="ClassWithAttributes" name="ClassWithAttributes"
type="table" />
<DiagramBaseInitiationBlock>
<StaticText content="Children" style="Heading 2 (VP)" />
<ParagraphBreak />
<HasChildElementChecker flag="true">
<TableBlock alignment="right" colWidths="5000,5000"
tableWidth="14500">
<TableRow>
<TableCell color="230, 230, 230" leftBorderEnable="false"
rightBorderEnable="false">
<StaticText content="Name" style="Column header 1" />
</TableCell>
<TableCell color="230, 230, 230" leftBorderEnable="false"
rightBorderEnable="false">
<StaticText content="Type" style="Column header 1" />
</TableCell>
</TableRow>
<IterationBlock modelType="Class">
<TableRow>
<TableCell leftBorderEnable="false" rightBorderEnable="false">
<StringPropertyText propertyText="name"
style="Table Contents" />
</TableCell>
<TableCell leftBorderEnable="false" rightBorderEnable="false">
<StringPropertyText propertyText="documentation"
style="Table Contents" />
</TableCell>
</TableRow>
<!-- Iterate thru the attributes -->
<IterationBlock modelType="Attribute">
<TableRow>
<TableCell leftBorderEnable="false" rightBorderEnable="false">
<StaticText content="Attribute " style="Table Contents" />
<StringPropertyText propertyText="name"
style="Table Contents" />
</TableCell>
<TableCell leftBorderEnable="false" rightBorderEnable="false">
<StringPropertyText propertyText="documentation"
style="Table Contents" />
</TableCell>
</TableRow>
</IterationBlock>
</TableBlock>
</HasChildElementChecker>
<StaticText content="" style="Default" />
</DiagramBaseInitiationBlock>
</Template>
TIA.
Ion