* @param out
* @return the serializer
*/
public BaseMarkupSerializer getSerializerByName (String serializerName, java.io.Writer out) {
if (serializerName != null && serializerName.equals("WML")) {
OutputFormat frmt = new OutputFormat("wml", "UTF-8", true);
frmt.setDoctype("-//WAPFORUM//DTD WML 1.1//EN", "http://www.wapforum.org/DTD/wml_1.1.xml");
return new XMLSerializer(out, frmt);
} /* else if (serializerName != null && serializerName.equals("PalmHTML")) {
OutputFormat frmt = new OutputFormat("HTML", "UTF-8", true);
return new PalmHTMLSerializer(out, frmt);
} */ else if (serializerName != null && serializerName.equals("XML")) {
OutputFormat frmt = new OutputFormat("XML", "UTF-8", true);
return new XMLSerializer(out, frmt);
} else if (serializerName != null && serializerName.equals("XHTML")) {
OutputFormat frmt = new OutputFormat("XHTML", "UTF-8", true);
frmt.setPreserveSpace(true);
frmt.setIndenting(outputIndenting);
frmt.setDoctype("-//W3C//DTD XHTML 1.0 Transitional//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd");
frmt.setOmitDocumentType(omitDoctype);
return new CachingXHTMLSerializer(out, frmt);
} else {
// default case is HTML, such as that for netscape and explorer
OutputFormat frmt = new OutputFormat("HTML", "UTF-8", true);
frmt.setPreserveSpace(true);
frmt.setIndenting(outputIndenting);
frmt.setDoctype("-//W3C//DTD HTML 4.01 Transitional//EN", "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd");
frmt.setOmitDocumentType(omitDoctype);
return new CachingHTMLSerializer(out, frmt);
}
}