[4suite] exception "not well formed" on a file which passes validation using XMLSpy 2005
Werner F. Bruhin
werner.bruhin at free.fr
Sat Nov 7 03:34:38 MST 2009
I am running into the following exception:
**** Sat Nov 07 11:20:59 2009 ****
Traceback (most recent call last):
File "D:\Dev\twcbTrunk\Program\dialogxmlimport.py", line 547, in
OnFileListListItemSelected
self.LoadItemData(self.fileName)
File "D:\Dev\twcbTrunk\Program\dialogxmlimport.py", line 487, in
LoadItemData
self.ParseXML(fileName)
File "D:\Dev\twcbTrunk\Program\dialogxmlimport.py", line 513, in ParseXML
self.xmlDoc = binderytools.bind_file(file)
File "C:\Python25\lib\site-packages\amara\binderytools.py", line 99,
in bind_file
binding_classes=binding_classes)
File "C:\Python25\lib\site-packages\amara\binderytools.py", line 78,
in bind_uri
binding = binderobj.read_xml(isrc, validate)
File "C:\Python25\lib\site-packages\amara\bindery.py", line 261, in
read_xml
parser.parse(input_source)
SAXParseException:
file:///D:/Dev/twcbTrunk/data/xmlImport/gws-quinta_do_mouro_vinho_regional_alentejano_rotulo_dourado.vinoxml:1:1068:
not well-formed (invalid token)
I am loading it using:
file = os.path.join(self.xmlImportFolder, fileName)
self.xmlDoc = binderytools.bind_file(file)
The error is due to the elements "<producer><name>" and
"<producer><email>", they contain some characters which are using escape
sequences (correct term?). If I remove/replace them it is fine.
These files are generated by someone else, I will let them know. But I
wonder if I can do something on my side to accept them, e.g. replace the
bad chars with a ? or something along these lines by setting some amara
configuration value or maybe use another function.
Appreciate any tips on this.
Werner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gws-quinta_do_mouro_vinho_regional_alentejano_o_mouro.vinoxml
Type: application/vinoxml
Size: 1386 bytes
Desc: not available
URL: <http://lists.fourthought.com/pipermail/4suite/attachments/20091107/bcdaeb00/attachment.bin>
More information about the 4suite
mailing list