So I’m trying to send a string like this
<message to="me"><body>\<foobar\></body></message>
The brackets seem to stop the transmission of the message, is there any way to escape the characters for example? How can I do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to properly escape the content for XML. In your case, the message must end up like this:
For an entity escaper, have a look into StringEscapeUtils (I assume that you’re doing this in Java).