Ignore:
Timestamp:
2008-07-14T12:10:15+12:00 (16 years ago)
Author:
davidb
Message:

Change to Skin code (returning Node note Element) so XSLT encodes its DocType -- important information for IE to render resultant HTML correctly. This also required Skin.java to be changed from using DomResult to StreamResult. The former is known to have a problem with loosing its DocType info, and as it's then read-only, has no elegant way to put back this info.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/src/java/org/greenstone/gsdl3/util/XMLConverter.java

    r13210 r16374  
    2121// XML classes
    2222import org.w3c.dom.Document;
     23import org.w3c.dom.DocumentType;
    2324import org.w3c.dom.Node;
    2425import org.w3c.dom.NodeList;
     
    173174
    174175    if (nodeType == Node.DOCUMENT_NODE) {
    175         getString(((Document)xmlNode).getDocumentElement(), xmlRepresentation, depth, pretty);
     176        Document xmlDocNode = (Document)xmlNode;
     177       
     178        if (xmlDocNode.getDoctype() == null) {
     179        System.err.println("Doctype is null.");
     180        }
     181        else {
     182       
     183        DocumentType dt = xmlDocNode.getDoctype();
     184       
     185        String name = dt.getName();
     186        String pid  = dt.getPublicId();
     187        String sid  = dt.getSystemId();
     188       
     189        String doctype_str = "<!DOCTYPE " + dt.getName() + " PUBLIC \"" + pid + "\"" + sid + "\">\n";
     190       
     191        xmlRepresentation.append(doctype_str);
     192        }
     193        getString(xmlDocNode.getDocumentElement(), xmlRepresentation, depth, pretty);
    176194        return;
    177195    }
Note: See TracChangeset for help on using the changeset viewer.