Expand my Community achievements bar.

Handle special characters in xml

Avatar

Former Community Member

Hi,

  Our end users tend to copy the description text from Word documents to pdf form and submits it.

If that text contains any special characters, its getting carried to the extracted xml. In the next step, when I try to assign a task to user with template and this xml, Managers cannot able to open the form and showing the error. When I assign the xml without special characters, its running fine.

image1.jpg

Please assist on how to handle this?

My expectation is that user should be prompted in the form when he pastes any special characters or they should be auto-corrected to null values. if that is not possible, atleast we should able to filter the xml and eliminate special characters before the form go to next stage.

Appreciate your help.

Thanks,

Krishna

5 Replies

Avatar

Level 8

Are the fields rich text fields or plain text?

Avatar

Former Community Member

My apologies for the delayed response. I'm using the default text fields we find in Library. Not sure how to find if it accepts rich or plain text.

Any help appreciated.

Thanks,

Avatar

Level 8

On the field pallete there is a Field Format dropdown, by default its Plain Text Only change it to Rich Text

Avatar

Former Community Member

Hi Steve,

  Thanks for that. Do you mean changing this would solve the problem of rendering form?

Avatar

Former Community Member

In first instance, I would have followed this way:

http://www.dvteclipse.com/documentation/svlinter/How_to_use_special_characters_in_XML.3F.html

so, I would have parsed the submitted text in a Validate event and changed any special chars to UTF-8 numeric reference.

However, I found this:

http://blog.mark-mclaren.info/2007/02/invalid-xml-characters-when-valid-utf8_5873.html

which seems to state that not all UTF-8 characters are possible in XML.

In fact, those allowed are listed here:

http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char

so, I would still use a Validate event script but based on the XML specs' Character Range. Exactly as Mark McLaren did in Java.

This will permit to keep those special chars that are allowed. Your Managers will thank you.

Hope it helps.