M2DOC m:template reverses output sequence

Hi,

the following template is used to construct a table (parenthesis are intentionally left out):

m:template createExchangeItemTable(exchangeItem:information::ExchangeItem)
m: testExchangeItem.createHeader()
m:for exchangeItemElement | testExchangeItem.ownedElements
m: 1.createBlockOfRows(exchangeItemElement)
m:endfor
m:endTemplate

m: testExchangeItem.createExchangeItemTable()

The issue is that the rows are reversed (LIFO) in the generated document, when the above template is used:

… as opposed to simply using the exactly same code not wrapped in a template:

m: testExchangeItem.createHeader()
m:for exchangeItemElement | testExchangeItem.ownedElements
m: 1.createBlockOfRows(exchangeItemElement)
m:endfor

which generates the correct table:

We are using m2doc 3.0.0. Is this issue known and corrected in a newer version of m2doc?

The list of known issues are listed here.

We had some issues in the past regarding tables and/or templates constructs. It’s possible that one of the following bug fixes resolve your issue using a newer version of M2Doc:



If the problem is still present with M2Doc 3.1.0 please open an issue.