I try to get the data from the XML and import into CSV
I am using Eclipse
I want to get the element in my <editor>
and <author>
for example
<author>Jochen Dörre</author>
was return as örre
in my csv
What is wrong? I already try to use String strEscapeHTML = StringEscapeUtils.escapeHtml4(temp);
OutputStreamWriter oswAuthor =
new OutputStreamWriter(fosAuthor,Charset.forName("ISO-8859-1"));
Below is the code I use for endElement, it get character only after the HTML string
what is wrong? How should I change it?
public void endElement(String nameSpaceURI, String localName, String qName) {
System.out.println("</" + qName + ">");
/*
if(qName.equals("author") || qName.equals("editor")) {
//fosAuthor.println(authorID + "," + );
}*/
if(eName.equals("author") || eName.equals("editor")) {
//byte[] b = temp.getBytes(Charset.forName("UTF-8"));
String strEscapeHTML = StringEscapeUtils.escapeHtml4(temp);
String strUnEscapeHTML = StringEscapeUtils.unescapeHtml4(strEscapeHTML);
pwAuthor.println(authorID + "," + strUnEscapeHTML);
//fosAuthor.write(authorID + "," + temp + "\n");
authorID++;
}
}