>From: Béres Botond >Sent: Tuesday, May 24, 2011 5:51 AM > > Hi Dave, > > First of all I like what you've done with generateDS, it's really a > great tool for working with XML schemas, thanks! >
Béres - Thanks and you are welcome. More below. > When I've tested it with a schema I've noticed a strange issue, > regarding generating validators for simpleType-s. According to the > documentation the superclass should get some validator stubs > generated and those should be called in the build methods as well. > But for the XSD I was working with, nothing like that was generated, > just some generic validators like *gds_validate_double*, > *gds_validate_float* etc. > > Example simpleTypes below: (I have half-expected it to maybe trip on > the 2nd type of definition, but it doesn't generate any validators > for first one either) I believe that you've found a bug. This seems to be working for an attribute declared as a simpleType, but not for a *child* declared as a simpleType. First, let's make sure we agree on what generateDS.py is trying to do. What generateDS.py tries to do is to generate a validator method in the class that contains a reference to a simpleType. So, for example, if you look in the file Demos/People/people.xsd in the distribution, you will find a definition of a simpleType "FlowType" and a reference to that time in the complexType "param", that is, param contains an attribute declared as type FlowType. So, generateDS.py generates a class param containing a method named validate_FlowType. And, in the buildAttributes method in class param, there is a call to validate_FlowType. As I mentioned, the above is happening correctly, I believe, for attributes, but not for children (element content). I believe that I've made a patch that fixes this. But, I've made other changes to generateDS.py so I don't think I can send you a patch/diff file. In a separate message, I'll send you a copy of my latest generateDS.py that you can test. Hopefully, I'll have time to do more testing and will release a new version that contains this fix next week. It's also the case that in buildChildren, there are now calls to 2 validators: the generic one (e.g. for xs:string) and the specific simpleType one. I'll have to think about whether we want that or should remove the generic one. Thanks for reporting this and for sending that schema snippet for me to test against. - Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ------------------------------------------------------------------------------ vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 _______________________________________________ generateds-users mailing list generateds-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/generateds-users