I am using the MailMerger.performMerge which is working fine in most cases but I have a library of documents where some of the merge fields have incorrectly spanned across multiple instructions and the performMerge is throwing null pointer exception.
So the xml looks like this:
<w:p w:rsidR="000060E0" w:rsidRDefault="00EF2C0C" w:rsidP="000060E0">
<w:r>
<w:fldChar w:fldCharType="begin" />
</w:r>
<w:r>
<w:instrText xml:space="preserve"> MERGEFIELD D6_15_0#Blank_Field</w:instrText>
</w:r>
<w:r>
<w:instrText xml:space="preserve"> \* MERGEFORMAT </w:instrText>
</w:r>
<w:r>
<w:fldChar w:fldCharType="separate" />
</w:r>
<w:r w:rsidR="000060E0"> ...