Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Handle special characters in xml

kc_chaitu
Level 5
Level 5

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
TundraSteve
Level 8
Level 8

Are the fields rich text fields or plain text?

kc_chaitu
Level 5
Level 5

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,

TundraSteve
Level 8
Level 8

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

kc_chaitu
Level 5
Level 5

Hi Steve,

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

Anonymous
Not applicable

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.