On Thu, Jul 07, 2016 at 10:55:55AM +0100, Marc Capavanni wrote: > Hi there, > First off, apologies if you'd rather not have this kind of email > traffic, if you know anywhere where I'd be better asking for help, > please let me know.Â
Marc, Direct email to me is fine. But, there is an email list for generateDS, if you'd rather use that. You can find out about it here: https://lists.sourceforge.net/lists/listinfo/generateds-users > I'm using an XSD just now which has multiple elements at various points > in the file which all have the name "goodnessOfFit". > When accessing this in the generated API, I get the following. > Inline images 1 > I was wondering if there was anything I could do to improve on this > situation. And if not, could you tell me the logic of the numbering, so > that I could narrow down which particular XSD element it is referring > to? XML schemas can have multiple nested element definitions with the same name and restricted scope. However, since generateDS.py generates a single module, it also must generate classes with unique names. Maybe there are ways of fixing this, perhaps involving classes nested inside classes or generating multiple modules. But, every time I've tried to implement something along those lines, I've become hopelessly confused, and have given up. There is some code in the existing implementation that handles anonymous, nested element definitions. That code raises those nested definitions to the top level of the schema and gives them unique names by appending a number to the name if needed. That code is in process_includes.py. Look for functions named raise_anon_complextypes, which calls function unique_name to generate a unique name. Perhaps you can get some hints and clues by taking a look at that code. I do not have your schema, so I don't know for sure whether this is the code that is handling your duplicate names. My suggestion would be to put a print statement or two in that code to determine if it's what is handling your situation. Hope this helps. And, if you send me your XML schema, I'll take a look. Dave -- Dave Kuhlman http://www.davekuhlman.org ------------------------------------------------------------------------------ Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape _______________________________________________ generateds-users mailing list generateds-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/generateds-users