public static String whichDoctypePublic(Document doc){
  DocumentType doctype;
  doctype=doc.getDoctype();
  if (doctype != null) {
    try {
      return doctype.getPublicId();
    }
 catch (    Error except) {
    }
  }
  if (doc instanceof HTMLDocument)   return DTD.XHTMLPublicId;
  return null;
}

public static String whichDoctypePublic ( Document doc ) { DocumentType doctype ; doctype = doc . getDoctype ( ) ; if ( doctype != null ) { try { return doctype . getPublicId ( ) ; } catch ( Error except ) { } } if ( doc instanceof HTMLDocument ) return DTD . XHTMLPublicId ; return null ; }
returns the document type public identifier specified for this document , or null .
