Data handling in docx from dynamic template

Certified Senior Developer

Hi All,

How to handle the '&' in data, while using the docx from dynamic template.

I am already using the toHtml() and expression rule for escaping xml characters but after that also '&' is converting into '&'

and

if I don't use toHtml() and expression rule for escaping xml characters, then i got the error in dynamic template as"The entity name must immediately follow the '&' in the entity reference.".

Please suggest.

  Discussion posts and replies are publicly visible

Parents
  • What is the code for your "expression rule for escaping xml characters"?  toHtml() already converts "&" to "&", and if your expression rule does the same thing (which is my guess), you're probably ending up with "&" which would render in your resulting Word file as literally "&" when you don't intend it to.

    My overall recommendation would be to make sure the expression rule handles all text correctly, and get rid of toHtml() -- however one way or the other, you might need to make sure you're not doing things twice.

Reply
  • What is the code for your "expression rule for escaping xml characters"?  toHtml() already converts "&" to "&", and if your expression rule does the same thing (which is my guess), you're probably ending up with "&" which would render in your resulting Word file as literally "&" when you don't intend it to.

    My overall recommendation would be to make sure the expression rule handles all text correctly, and get rid of toHtml() -- however one way or the other, you might need to make sure you're not doing things twice.

Children
No Data