I have an xml in which it contails <br/> tag in the element data fiels. I am able to parse it using string builder in Sax parser. Now i want to trim down some of the tags and return back an xml response. In the response xml source i am getting the tag replaces as <br/>. My concern is that the “<” gets replaced by < but the “>” tag does not get replaced by >. Anybody has idea of how to sort out this problem.
I have an xml in which it contails <br/> tag in the element data
Share
You should escape for XML.
Try EscapeUtils from Apache Commons Lang.
Mind that also Java may be having trouble dealing with it.
I prefer first to escapeJava and after that escapeXML.
Usage:
Apache Commons Lang download link.