> From: Sergii Chernysh

>Sent: Wednesday, January 16, 2013 7:39 AM
> 
> FROM: Sergii Chernysh
> TO: generateds-users@lists.sourceforge.net  
> Wednesday, January 16, 2013 8:23 AM
> 
> I've noticed the problem in generated file for this piece of xsd:
> 
> <xs:complexType name="typeOne">
>   <xs:sequence>
>     <xs:element name="someNumber" type="xs:int" minOccurs="0" maxOccurs="2"/>
>    </xs:sequence>
> </xs:complexType>
> 
> Here is the extract from exportLiteralChildren method of corresponding type:
> 
> for someNumber_ in self.someNumber:
>   showIndent(outfile, level)
>   outfile.write('%d,\n' % someNumber)
> It could be seen that the third line references not existing variable 
> someNumber while someNumber_ is meant to be there as far as i understand.
> 
> It seems like the name var with _ appended should be passed to 
> generateExportLiteralFn, not the name var itself (see following snippet from 
> generateDS.py#generateExportLiteralFn):
> 
> wrt(" for %s_ in self.%s:\n" % (name, mappedName))
>  generateExportLiteralFn_2(wrt, child, name, ' ')
> 
> Looks like a bug.
> 
> Thanks.

Sergii -

Thanks for reporting this.

OK, I've fixed this.  There was the same error for other built-in data
types, and I've fixed those, too.  And, I added something to the
unit tests that will hopefully enable me to check for related
problems in the future.


In a separate email, I've attached a copy of generateDS.py (from version 2.8a)
with these fixes included.  I've also attached (to this message) a patch file 
made against
version 2.8a, in case you have to try to fix an earlier version of
generateDS.py, although if you are *not* using v. 2.8a, I'd suggest
that you upgrade (by using the attached copy of generateDS).

Thanks again for letting me know about this.  And, hope this helps.

- Dave

--


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

Attachment: builtin_types.patch
Description: Binary data

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to