> From: Dave Kuhlman <dkuhl...@pacbell.net>
> To: Daniel Browne <daniel.bro...@voss-solutions.com>; 
> "generateds-users@lists.sourceforge.net" 
> <generateds-users@lists.sourceforge.net>
> Cc: 
> Sent: Thursday, January 10, 2013 2:59 PM
> Subject: Re: [Generateds-users] (no subject)
> 
>>  From: Daniel Browne
> 
>> Sent: Wednesday, January 9, 2013 11:54 PM
>> 
>>  I get an error when using an XSD with only a simpleType in it.
>> 
>>  Is there anyway around this error or will the code have to be patched?
>> 
>>  Thanks
>> 
>> 
>>  XSD:
>> 
>>  <?xml version="1.0"?>
>>  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
> elementFormDefault="qualified">  
>>      <xs:simpleType name="BatchItemStatusCode">
>>          <xs:restriction base="xs:string">
>>              <xs:enumeration value="ERROR"/>
>>              <xs:enumeration value="STARTED"/>
>>              <xs:enumeration value="DONE"/>
>>          </xs:restriction>
>>      </xs:simpleType>
>>  </xs:schema>
>> 
>>  error:
>> 
>> 
> danielb@danielb-Latitude-E5520:~/Code/voss2/src/deviceapi/lib/model/device/cuc/v9_0$
>  
> generateDS.py -o test.py BatchResult.xsd 
>>  Traceback (most recent call last):
> [snip]
>>    File 
> "/usr/local/lib/python2.7/dist-packages/generateDS-2.7c-py2.7.egg/EGG-INFO/scripts/generateDS.py",
>  
> line 4293, in generate
>>      generateMain(outfile, prefix, root)
>>    File 
> "/usr/local/lib/python2.7/dist-packages/generateDS-2.7c-py2.7.egg/EGG-INFO/scripts/generateDS.py",
>  
> line 3747, in generateMain
>>      name = RootElement or root.getChildren()[0].getName()
>>  IndexError: list index out of range
>> 
> 
> Daniel -
> 
> Thanks for reporting this.
> 
> I've made a change so that code where this exception occurs is now
> protected by a test (if-statement).
> 
> However, the resulting file has no data representation classes
> (classes that correspond to XML elements).  So, I'm not sure how
> much use it will be.
> 
> Is this what you expect?
> 
> I've attached the new version of generateDS.py to a separate email
> (so as not to add too much bulk to messages sent to the list).
> 
> Let me know what you think about this fix.
> 
> There are a number of other changes in this version, which will be
> released soon and labeled version 2.8a, I believe.  Here are notes
> from the README.
> 
> # ==================================================================
> Version 2.8a (01/10/2013)
>   * Fix to process_includes.py so as to remove the limitation on the
>     number of unique names it can generate when raising anonymous
>     types to the top level.  Thanks to Daniel Browne for help with
>     this.
>   * Added support for multiple level attributeGroup, i.e. for
>     attribute groups that themselves contain references to other
>     attribute groups.  Thanks to Harley Green for pointing out the
>     need for this.  Also added a unit test for attribute groups.
>   * Added support for more date and time simple types, specifically
>     gYear, gYearMonth, gMonth, gMonthDay, and gDay.  Thanks to
>     Nicholas Krasney for catching this.  Added tests in the unit
>     tests for these types.
>   * Quite a bit of code clean-up with the help of the flake8 Python
>     code checker.  (See: http://pypi.python.org/pypi/flake8 for info
>     about the flake8 Python code checker.  I use it with the
>     Syntastic plugin for the Vim text editor.)
>   * Added generation of a dictionary that maps element definition
>     names to generated class names.  Thanks to Elena Dolinin for the
>     original work on this one.
>   * Added support for xs:date and xs:dateTime.  These are now
>     captured as instances of class datetime.datetime from the Python
>     standard library.  They are parsed and exported with the help of
>     that class and using methods gds_format_date,
>     gds_format_datetime, gds_parse_date, and gds_parse_datetime in
>     class GeneratedsSuper (which is part of the generated module).
>     Logan Owen did the work on this.  Thanks much to Logan for
>     implementing this and contributing this patch.
>   * Turned logging off.  I did not realize that generateDS.py had
>     been creating a log file (generateDS.log).  Logging can be
>     turned back on by modifying the logging calls near the top of
>     generateDS.py.
>   * Fixed exception that is thrown when the XML schema file (.xsd)
>     only contains a simple type.  Now, the output is generated, but
>     it contains no data representation classes.  Thanks to Daniel
>     Browne for catching this.
> # ==================================================================
> 
> - Dave
> 
> --
> 
> 
> Dave Kuhlman
> http://www.rexx.com/~dkuhlman
> 

------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to