We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Incorrect behaviour with an erroneous space?

I was hoping someone could help.


I have 2 documents with MergeFields. They are both identical except one has what looks like a space after the TableStart tag.

Aspose handles them very differently. The file without the space is processed correctly. The file with the extra space attempts to get values for MergeFields inside the TableStart/TableEnd from the root DataSource rather than from the child DataSource.

I’ve attached both of the files I have been testing with along with their associated output after merging with a dummy data source (getValue() simply returns {tableName}_{name of the tag}-value for testing purposes).

The only different between the 2 document.xml files within the 2 .docx’s is the file causing the problem has this additional XML chunk.

<w:r w:rsidR=“00B13DF9”>
<w:rPr>
<w:rFonts w:ascii=“Tahoma” w:hAnsi=“Tahoma” w:cs=“Tahoma”/>
</w:rPr>
<w:t xml:space=“preserve”/>
</w:r>

Can anyone suggest a way of avoiding this in the future?

Hi Paul,


Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 13.5.0, I was unable to reproduce this issue on my side. I would suggest you please upgrade to the latest version of Aspose.Words. You can download it from the following link:
http://www.aspose.com/community/files/72/java-components/aspose.words-for-java/default.aspx

I hope, this helps.

Best regards,