How to fix generateDS error: "Can't find file TObject.xsd referenced in <_io.BufferedReader name='some_name.xsd'>."

I am using generateDS (http://www.davekuhlman.org/generateDS.html) to create python classes by some XSD, to create different XML files with python then. It works properly with some simple XSD files, but when I try the one I need, it gives me an error "process_includes.SchemaIOError: Can't find file TObject.xsd referenced in <_io.BufferedReader name='shipporder.xsd'>.".

Actually I have no idea how to fix it.

python generateDS.py -o lib_test.py  shipporder.xsd

Upvotes: 2

Views: 248

Answers (1)

JustWe
JustWe

Reputation: 4484

I met the same issue. In your case, it's caused by missing file TObject.xsd.

You may wonder where TObject.xsd comes? it supposes to be found in your shipporder.xsd, something like

<xsd:import schemaLocation="TObject.xsd" ...

generateDS load all XSD not only indicated in arguments but also XSD files that are imported. So make sure TObject.xsd is existed.


The actual problem is generateDS didn't give an understandable error message.

Upvotes: 1

Related Questions