Code example for DocumentType

Methods: getPublicId

0
           doctype = doc.getDoctype();
           if ( doctype != null ) {
           // Note on catch: DOM Level 1 does not specify this method 
           // and the code will throw a NoSuchMethodError 
           try { 
           return doctype.getPublicId();
           } catch ( Error except ) {  }
           } 
         
        if ( doc instanceof HTMLDocument )
            return DTD.XHTMLPublicId;
        return null; 
    } 
 
 
    /** 
     * Returns the document type system identifier 
     * specified for this document, or null. 
     */ 
    public static String whichDoctypeSystem( Document doc )
    {