Ignore:
Timestamp:
2010-11-22T17:32:16+13:00 (13 years ago)
Author:
sjb48
Message:

Continued work on XHTML parsing for format statement saving. Found js code for ensuring XHTML (innerXHTML). Removed a few unneccessary bits of code from default servlet that were lingering around from when we first started playing with format statements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/SystemAction.java

    r23333 r23336  
    1717import javax.xml.parsers.DocumentBuilder;
    1818import javax.xml.parsers.DocumentBuilderFactory;
     19
     20import java.io.PrintWriter;
     21import java.io.StringWriter;
    1922
    2023import org.apache.log4j.*;
     
    7578            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    7679            DocumentBuilder builder = factory.newDocumentBuilder();
    77             InputSource is = new InputSource( new StringReader( format_string ) );
     80            String input = "<html><head><title></title></head><body>" + format_string + "</body></html>";
     81            InputSource is = new InputSource( new StringReader( input ) );
    7882            Document d = builder.parse( is );
    7983            page_response.appendChild(d);
     
    8185        catch( Exception ex ) {
    8286            logger.error("There was an exception "+ex);
     87           
     88            StringWriter sw = new StringWriter();
     89            PrintWriter pw = new PrintWriter(sw, true);
     90            ex.printStackTrace(pw);
     91            pw.flush();
     92            sw.flush();
     93            logger.error(sw.toString());
    8394        }
    8495
Note: See TracChangeset for help on using the changeset viewer.