Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Daiim on June 06, 2025, 07:34:45 pm
-
I try to generate a table of neighbors for a given element via document generation, but only get one entry as a result.
The document template is called for each element and uses a Custom Query (more precise a Custom Script) being called with the #OBJECTID# as parameter.
The script iterates over all neighbors via API and returns a XML for a list of entities, e.g. { Application : "Sparx EA", Vendor: "SparxSystems", Homepage: "https://sparxsystems.com" }.
The XML structure is:
<?xml version="1.0" encoding="UTF-8"?>
<EADATA>
<Dataset_0>
<Data>
<Row>
<Application>Sparx EA</Application>
<Vendor>SparxSystems</Vendor>
<Homepage>http://sparxsystems.com</Homepage>
</Row>
</Data>
</Dataset_0>
<Dataset_1>
<Data>
<Row>
<Application>Word</Application>
<Vendor>Microsoft</Vendor>
<Homepage>https://microsoft.com</Homepage>
</Row>
</Data>
</Dataset_1>
</EADATA>
The script template uses a table with a table header and a single row with the custom fields {Application}, {Vendor} and {Homepage}.
What must I do, that all results (Dataset_0 to Dataset_i) are rendered as rows into the table?
Thank you very much for any hint or tip!
Best regards,
Daiim
-
AFAIK you can only use one dataset per fragment (but with multiple rows)
You just repeat the <row>
Geert
-
Thank you Geert, this was the point. :D