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/core/TransformingReceptionist.java

    r13270 r16374  
    116116
    117117
    118     protected Element postProcessPage(Element page) {
     118    protected Node postProcessPage(Element page) {
    119119   
    120120    // might need to add some data to the page
    121121    addExtraInfo(page);
    122122    // transform the page using xslt
    123     Element transformed_page = transformPage(page);
     123    Node transformed_page = transformPage(page);
    124124   
    125125    return transformed_page;
     
    132132     * we need to get any format element out of the page and add it to the xslt
    133133     * before transforming */
    134     protected Element transformPage(Element page) {
     134    protected Node transformPage(Element page) {
    135135
    136136    logger.debug("page before transfomring:");
     
    184184        format_doc.appendChild(format_doc.importNode(format_elem, true));
    185185        Element new_format = (Element)this.transformer.transform(stylesheet_doc, format_doc);
    186         logger.debug("new format elem="+this.converter.getPrettyString(new_format));
     186        logger.debug("new format elem="+this.converter.getPrettyString(new_format));
    187187       
    188         // add it in to the main stylesheet
     188        // add it in to the main stylesheet
    189189        GSXSLT.mergeStylesheets(style_doc, new_format);
    190190        } else {
     
    196196    }
    197197   
    198     // there is a thing called a URIResolver which you can set for a transformer or transformer factory. may be able to use this instead of this absoluteIncludepaths hack
    199     GSXSLT.absoluteIncludePaths(style_doc, GlobalProperties.getGSDL3Home(), (String)this.config_params.get(GSConstants.SITE_NAME), collection, (String)this.config_params.get(GSConstants.INTERFACE_NAME), base_interfaces);
    200     // put the page into a document - this is necessary for xslt to get the paths right if you have paths relative to the document root eg /page.
     198    // there is a thing called a URIResolver which you can set for a
     199    // transformer or transformer factory. may be able to use this
     200    // instead of this absoluteIncludepaths hack
     201
     202    GSXSLT.absoluteIncludePaths(style_doc, GlobalProperties.getGSDL3Home(),
     203                    (String)this.config_params.get(GSConstants.SITE_NAME),
     204                    collection, (String)this.config_params.get(GSConstants.INTERFACE_NAME),
     205                    base_interfaces);
     206
     207    // put the page into a document - this is necessary for xslt to get
     208    // the paths right if you have paths relative to the document root
     209    // eg /page.
     210
    201211    Document doc = this.converter.newDOM();
    202212    doc.appendChild(doc.importNode(page, true));
Note: See TracChangeset for help on using the changeset viewer.