Changeset 1048 for TI07-MOLES/trunk


Ignore:
Timestamp:
26/05/06 21:37:53 (13 years ago)
Author:
lawrence
Message:

mucking around with unicode issues for parsing DIF's ...

Location:
TI07-MOLES/trunk/StubB/XSLT/browse/portal/cgi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/StubB/XSLT/browse/portal/cgi/DIF.py

    r1047 r1048  
    1616        '''Initialise a python dif instance based on an xml document ''' 
    1717        self.metadataType='DIF' 
    18         print type(xml) 
    1918        #self.xml=xml.decode('utf-8','replace') 
    2019        #self.xml=unicode(xml,'latin-1') 
    21         self.xml=xml.encode('latin-1','replace') 
     20        #self.xml=xml.encode('latin-1','replace') 
     21  
    2222        try: 
    2323            self.elem=ET.fromstring(xml) 
    2424        except: 
    2525            # for some reason we can't parse the document ... 
    26             import codecs 
    27             f=codecs.open('unparseable.xml','a','utf-8') 
    28             f.write(xml+'\n') 
     26            #print '<p>%s</p>'%xml[11385:11395] 
     27            #raise bnl 
     28            #import codecs 
     29            #f=codecs.open('unparseable.xml','a','utf-8') 
     30            #f.write(xml+'\n') 
    2931            self.elem=None 
    3032            return 
  • TI07-MOLES/trunk/StubB/XSLT/browse/portal/cgi/browseCGI.py

    r1047 r1048  
    117117                    #this is a redirect following login ... 
    118118                    cmdLine=(self.FieldStorage['NDG-ID1'],self.FieldStorage['NDG-ID2']) 
     119                else: cmdLine=None 
    119120                self.ndgGate=gateway2NDGsession(self.requestURL,aa,cookie=cookie,cmdLine=cmdLine) 
    120121 
Note: See TracChangeset for help on using the changeset viewer.