>From: "Ulbrich, Stefan"
>Sent: Thu, January 20, 2011 5:31:42 AM
>
> I want to generate python code for the COLLADA XML format (COLLADA
> 1.5.0 Schema).  I've got a fresh python 2.7 installation on mac,
> and lxml (xml-2.3beta1-py2.7-macosx-10.6-intel.egg ) installed. 
> However, I get the following error on running generateDS.py:
> 
> generateDS.py -o collada.py -s colladasubs.py collada_schema_1_5.xsd 
> Traceback (most recent call last):
>   File "/Library/Frameworks/Python.framework/Versions/2.7/bin/generateDS.py", 
>line 5, in <module>
>     pkg_resources.run_script('generateDS==2.3b', 'generateDS.py')
>   File 
>"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py",
> line 489, in run_script
>   File 
>"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py",
> line 1214, in run_script

[snip]

>   File 
>"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/generateDS-2.3b-py2.7.egg/EGG-INFO/scripts/process_includes.py",
> line 77, in resolve_ref
>   File 
>"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py",
> 
>line 83, in split
>     i = p.rfind('/') + 1
> AttributeError: 'NoneType' object has no attribute 'rfind'
> 
> Any idea what goes wrong?
> 
> Thank you a lot,

Stefan -

It took me a bit of debugging and searching, but I was able to
track this down.

What is happening is that in the file
http://www.w3.org/Math/XMLSchema/mathml2/common/common-attribs.xsd
(which is imported by a file that is imported)
there is an import element that looks like this:

    <xs:import/>

process_includes.py thinks that all import elements should have an
attribute "schemaLocation", and it is not protecting itself when it
finds one that does not.  That import element looks like an error
to me, or at least it does not seem normal.  But, at any rate, I
suppose that process_includes.py should not crash.

So, I've modified process_includes.py so that it checks for that
condition (missing "schemaLocation" attribute"), and when it finds
that, now it prints a warning message and skips it.

With this modified version of process_includes.py, I was able to
generate bindings for the collada schema.

I've attached the patched version of process_includes.py in a
separate email to you.  I'll include it in the next version that I
upload.  In this temporary version I've left a print statement that
I used for debugging, so that you can see what files
process_includes.py is pulling in.  Remove that print statement if
it annoys you.

Thanks for letting me know about this.

If anyone else runs into this problem, please let me know and I'll
send you a patch, too.  Those of you who are not being bothered by
this problem, will get the fix in the next uploaded version.

- Dave

 -- 


Dave Kuhlman
http://www.rexx.com/~dkuhlman

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to