Posting XML without javascript
or browser plugins is impossible. You should not send it directly as a form parameter. See this answer for more info:.
Use a library that would encode
them while sending to server, and decode
them at the server side.
Underscore.js provides such functionality. See the documentation:
escape_.escape(string)
Escapes a string for insertion into HTML, replacing &, <, >, ", `, and ' characters.
_.escape('Curly, Larry & Moe');
=> "Curly, Larry & Moe"
unescape_.unescape(string)
The opposite of escape, replaces &, <, >, ", ` and ' with their unescaped counterparts.
_.unescape('Curly, Larry & Moe');
=> "Curly, Larry & Moe"
However, do keep in mind that usually browsers have limits over the amount of data that you can send through GET
request (around 255 bytes). Hence it's always a good option to use POST
instead of GET
even when sending encoded XML
.