Using Aspose Words for Java 14.3
Using XML as a merge source with an implementation of IMailMergeDataSource
I have an unexpected behavior with a nested region definition within a template document. I had to define more TableStart's and TableEnd's than I wanted to due to the issue defined at
<a href="https://forum.aspose.com/t/51088</a>. However, given that constraint, I created the nested region in a template document as defined below.</p><p>MyLabel: «TableStart:parent»«TableStart:child» «mydata»«TableEnd:child»«TableEnd:parent»<CR><br>where <CR> is a carriage return.</p><p>My XML is defined as </p><p><acme xmlns="http://www.acme.com/test">
.....
Accountnum1
Accountnum2
Accountnum3
.....
Due to the location of the TableStart and TableEnd tags (after MyLabel), my expectation was that the data between those start and end tags would be repeated such that each occurrence of mydata and the space before it would reside on the same line with a soft return to the next line if enough data was present to go beyond the end of one line. Data values would be space separated since it was included between start and end tags. My expectation was below:
MyLabel: Accountnum1 Accountnum2 Accountnum3
However, the merge result repeated the whole line. The result turned out like the following.
MyLabel: Accountnum1
MyLabel: Accountnum2
MyLabel: Accountnum3
As a result, the formatting of the document broke across 2 pages instead of 1 when the mydata element count was greater than 3.
Is there a way to create the my expected behavior or is this an unexpected use case for the Aspose merge library?