Changeset 5750 for MILK


Ignore:
Timestamp:
22/09/09 16:49:24 (10 years ago)
Author:
sdonegan
Message:

updated to add xml header and convert to ascii from unicode so can work in mod_wsgi buildout

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/controllers/browse/retrieve.py

    r5194 r5750  
    8686        if self.ndgDoc.status: 
    8787            response.headers['Content-Type'] = 'application/xml' 
    88             response.write(self.ndgDoc.xmlString) 
     88         
     89            #When using this with mod_wsgi apps need to explicitly add the xml declaration lost during ingestion as well 
     90            #as encode as string as mod_wsgi does not like the unicode!!  SJD 22/0/09 
     91            xmlReturn = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + self.ndgDoc.xmlString 
     92            response.write(xmlReturn.encode('ascii','ignore')) 
     93             
    8994        else: 
    9095            # the error templates should be set up already if there's an error 
Note: See TracChangeset for help on using the changeset viewer.