}
serializeElement( (Element) node );
break;
}
case Node.DOCUMENT_NODE : {
DocumentType docType;
// If there is a document type, use the SAX events to
// serialize it.
docType = ( (Document) node ).getDoctype();
if (docType != null) {
// DOM Level 2 (or higher)
try {
String internal;
_printer.enterDTD();
_docTypePublicId = docType.getPublicId();
_docTypeSystemId = docType.getSystemId();
internal = docType.getInternalSubset();
if ( internal != null && internal.length() > 0 )
_printer.printText( internal );
endDTD();
}
// DOM Level 1 -- does implementation have methods?
catch (NoSuchMethodError nsme) {
Class docTypeClass = docType.getClass();
String docTypePublicId = null;
String docTypeSystemId = null;
try {
java.lang.reflect.Method getPublicId = docTypeClass.getMethod("getPublicId", (Class[]) null);