xerces-j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Ye" <eri...@locus.apache.org>
Subject Serializer and DOM 2
Date Thu, 13 Apr 2000 22:23:18 GMT
    I just noticed in org.apache.xml.serialize.OutputFormat.java, there are following 2 methods,
in which DOM2 support was commented out. now that DOM2 has been part of the xerces code base,
so is it the time to fix this?

    /**
     * Returns the document type public identifier
     * specified for this document, or null.
     */
    public static String whichDoctypePublic( Document doc )
    {
        DocumentType doctype;
        
        /* XXX  Delayed until DOM Level 2 is introduced into the code base
           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 )
    {
        DocumentType doctype;
        
        /* XXX  Delayed until DOM Level 2 is introduced into the code base
           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.getSystemID();
           } catch ( Error except ) { }
           }
        */
        if ( doc instanceof HTMLDocument )
            return DTD.XHTMLSystemId;
        return null;
    }

_____

Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org


Mime
View raw message