Java
Chilkat2 Java
Decode HTML Entities found in XML
Demonstrates how to decode HTML entities found in XML.Chilkat Java Downloads
import com.chilkatsoft.chilkat2.Xml;
public class ChilkatExample {
public static void main(String[] args) {
// Load an XML file containing the following:
// <?xml version="1.0" encoding="UTF-8"?>
// <output>Französische</output>
Xml xml = new Xml();
xml.loadXmlFile("qa_data/xml/hasHtmlEntity.xml");
// Get non-decoded content, then get decoded content.
// Result is Französische
System.out.println(xml.getContent());
// Result is Französische
String strDecoded = xml.decodeEntities(xml.getContent());
System.out.println(strDecoded);
}
}