Dear All
We are facing an issue if I add '&' symbol in a text field while submitting a web form. if we are not adding the special character it works fine.
XML parsing is a issue I feel, even the '&' is changing to <varSetName>test&test</varSetName>. Not sure what is the issue, Please help me.
Below is the error while submitting,
We have found the script which is causing the issue.
xtk.session.Write(insertxml);
Script:
var insertxml ="<Data_Collection xtkschema=\"xxx:Data_Collection\" Salutation= \"" + ctx.vars.varSalutation +"\" FIRST_NAME= \"" + ctx.vars.varFirstname +"\" LAST_NAME= \"" + ctx.vars.varLastname +"\" EMAIL= \"" + ctx.vars.varEmail +"\" PHONE= \"" + ctx.vars.varTelephone +"\" Creation_Date=\""+ formatDate(new Date(),'%4Y-%2M-%2D %2H:%2N:%2S') +"\" Creation_Date_2=\""+ formatDate(getCurrentDate(),"%2D.%2M.%4Y") +"\" SetName= \"" + ctx.vars.varSetName +"\" Preis= \"" + ctx.vars.varPreis +"\" GueltigBis= \"" + ctx.vars.varGueltigBis +"\" _operation=\"insert\"></Data_Collection>";
xtk.session.Write(insertxml);
Error Message:
Unterminated entity reference, 'test' XML-110018 Error while parsing XML string '<__sessiontoken xsi:type='xsd:string'><' SOP-330011 Error while executing the method 'Write' of service 'xtk:persist|xtk:session'.
Please let me know if you need any details.
Thanks in advance
Ukender