- Timestamp:
- 21/06/06 09:19:11 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI02-CSML/trunk/parser/parseTest.py
r1148 r1226 44 44 45 45 46 46 def fixSpecial(file): 47 #Looks for the 5 'special' characters 48 # 49 return strXMLFixed 47 50 48 51 … … 50 53 sys.stderr = sys.stdout 51 54 print "Content-type: text/html" 52 print 55 print 53 56 print "<HEAD>" 54 57 print '<STYLE TYPE="text/css">' … … 62 65 print "<h1>CSML Test Parser</h1>" 63 66 print "<p>Please note this is experimental, any questions please contact d.lowe@rl.ac.uk</p>" 64 print "<p>Parser version - 09 June 2006 - includes NDG security elements</p>" 65 print "<h2>Load a CSML file to test:</h2>" 66 67 form = cgi.FieldStorage() 67 print "<p>Parser version - 21 June 2006 - includes NDG security elements, fixed unicode encoding</p>" 68 print "<h2>Load a CSML file totest:</h2>" 69 form= cgi.FieldStorage() 68 70 if not form: 69 print """<form action="http://glue.badc.rl.ac.uk/cgi-bin/csml/parseTest.py" method="POST" enctype="multipart/form-data"> 70 <input type="file" name="filename"> 71 <input type="submit"> 72 </form>""" 71 print """<form action="http://glue.badc.rl.ac.uk/cgi-bin/csml/parseTest.py" method="POST" enctype="multipart/form-data"> <input type="file" name="filename"> <input type="submit"></form>""" 73 72 elif form.has_key("filename"): 74 73 item = form["filename"] … … 122 121 strCSML= PrettyPrintHTML(csml) 123 122 strCSML=parser_extra.removeInlineNS(strCSML) 124 print strCSML 125 123 encodings = ['utf-8', 'utf-16', 'iso-8859-1'] 124 for encoding in encodings: 125 try: 126 strCSML=str(strCSML.encode(encoding)) 127 print strCSML 128 except UnicodeError: 129 pass 130 else: 131 break 126 132 print "</HEAD>" 127 133 main()
Note: See TracChangeset
for help on using the changeset viewer.