From vladimir.zykov at doctormobile.us Tue Mar 4 06:58:02 2014 From: vladimir.zykov at doctormobile.us (Vladimir Zykov) Date: Tue Mar 4 08:40:51 2014 Subject: [xsde-users] Wrong code generation with complicated imports Message-ID: <60711186-D5A1-4F70-B786-1FCA97FB2285@doctormofile.us> Hi Boris, I look in parallel at both xsd and xsde and here is a problem I faced with xsde. In case of complicated imports in XML schema xsde generates non-compilable code. Example of such documents is in the attachment. With a few tweaks in a Makefile it can be reproduced with a command 'make gen && make'. And here is my question. Is it possible to fix this without changing schema files? I understand that the problem can be solved by refactoring original XML schemas but this is what I want to avoid at all costs. The schemas that I deal with are huge and massive changes in them will make it very hard to switch to a new version of those schemas. Thanks. Vladimir Zykov Software Engineer Doctor Mobile, LLC From boris at codesynthesis.com Tue Mar 4 08:46:16 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Mar 4 08:49:26 2014 Subject: [xsde-users] Wrong code generation with complicated imports In-Reply-To: <60711186-D5A1-4F70-B786-1FCA97FB2285@doctormofile.us> References: <60711186-D5A1-4F70-B786-1FCA97FB2285@doctormofile.us> Message-ID: Hi Vladimir, Vladimir Zykov writes: > I look in parallel at both xsd and xsde and here is a problem I faced > with xsde. In case of complicated imports in XML schema xsde generates > non-compilable code. Example of such documents is in the attachment. Without looking further into the attachment, let me suggest that you try the file-per-type mode: http://www.codesynthesis.com/~boris/blog/2008/02/13/codesynthesis-xsd-3-1-0-released/ This article talks about XSD but the same functionality is available in XSD/e. A warning: for a large schema it may seem overwhelming at first since you will end up with a set of source files for each schema type. But that's the only sure way of dealing with schemas that have circular inclusions/imports (other than fixing them). Boris From vladimir.zykov at doctormobile.us Tue Mar 4 11:08:08 2014 From: vladimir.zykov at doctormobile.us (Vladimir Zykov) Date: Wed Mar 5 04:20:35 2014 Subject: [xsde-users] Wrong code generation with complicated imports In-Reply-To: References: <60711186-D5A1-4F70-B786-1FCA97FB2285@doctormofile.us> Message-ID: <6E8D4335-9E9E-41F5-8402-2BB7822CC005@doctormofile.us> Hi Boris, On Mar 4, 2014, at 3:46 PM, Boris Kolpackov wrote: > Without looking further into the attachment, let me suggest that you > try the file-per-type mode: Yes, I forgot to mention in my previous email that I used it and it fixes the problem but for my huge schemas I get 12120 files which is quite a lot even for make (generated from cmake). It takes quite long for make to check whether those files need rebuilding. I think there must be some workaround for this but before trying to find one I wanted to know if there is a better solution provided by xsde. Thanks Vladimir Zykov Software Engineer Doctor Mobile, LLC From vladimir.zykov at doctormobile.us Thu Mar 27 16:39:25 2014 From: vladimir.zykov at doctormobile.us (Vladimir Zykov) Date: Fri Mar 28 03:24:04 2014 Subject: [xsde-users] Complex type with post attribute/element Message-ID: <37072A21-E122-4E02-A1B1-0AECCEA21267@doctormofile.us> Hi Boris, For the following complex types xsde generates non-compilable code. What would be a fix for this issue? Same applies if the name is ?_post?, ?_pre?, ?pre' and probably some other names defined in base parser and serializer. Thanks Vladimir Zykov Software Engineer Doctor Mobile, LLC From boris at codesynthesis.com Fri Mar 28 07:17:35 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Mar 28 07:20:58 2014 Subject: [xsde-users] Complex type with post attribute/element In-Reply-To: <37072A21-E122-4E02-A1B1-0AECCEA21267@doctormofile.us> References: <37072A21-E122-4E02-A1B1-0AECCEA21267@doctormofile.us> Message-ID: Hi Vladimir, Vladimir Zykov writes: > For the following complex types xsde generates non-compilable code. What > would be a fix for this issue? Yes, that's the problem with having to override a specific virtual function defined in a base. An easy workaround is to make post (and other names that cause trouble) a reserved name: --reserved-name post Boris