I am trying to use the StringEscapeUtils.escapeXML () function from org.apache.commons.lang ...
There are two versions of this function, one of which expects (Writer, String) and one that just expects (String) ....
http://commons.apache.org/lang/api/org/apache/commons/lang/StringEscapeUtils.html#escapeXml(java.lang.String)
I am trying to use a version that just expects a String parameter without Writer, but Java complains that I did not give it a Writer.
How can I use this in my program so that I don't need Writer?
String escXml = StringEscapeUtils.escapeXml(attr.get()); xml = xml.concat("<"+attr.getID()+">"+escXml+"</"+attr.getID()+">");
I also tried just doing it inline in the line itself.
xml = xml.concat("<"+attr.getID()+">"+StringEscapeUtils.escapeXml(attr.get())+"</"+attr.getID()+">");
Both of these attempts gave me an error in this expectation of the writer. Can anyone help me with this?
Thanks Matt
source share