From pavel.fiala at cern.ch Wed Dec 4 09:29:32 2013 From: pavel.fiala at cern.ch (Pavel Fiala) Date: Wed Dec 4 09:29:42 2013 Subject: [xsde-users] Multiple restrictions Message-ID: <529F3C4C.4010000@cern.ch> Hello, I have a problem with attached XSD schema (it's just to illustrate the problem, final schema is more complex). There are multiple restrictions in the schema (myUSInt -> basicDataType [1;111] -> arrayDataType [64]) and XSDe produce uncompilable code: hybrid/restriction/restriction-pskel.cxx:975:68: error: ?class my::basicDataType_pskel? has no member named ?post_arrayDataType? I used this command: xsde cxx-hybrid --generate-parser --generate-serializer --generate-aggregate --generate-polymorphic --generate-typeinfo --polymorphic-type type restriction.xsd Should I change the command somehow to make it compilable or is it a bug/limitation in XSDe? Best regards, Pavel Fiala -------------- next part -------------- A non-text attachment was scrubbed... Name: restriction.xsd Type: text/xml Size: 1857 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20131204/e012c1e3/restriction.bin From boris at codesynthesis.com Thu Dec 5 01:52:15 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Dec 5 01:54:39 2013 Subject: [xsde-users] Multiple restrictions In-Reply-To: <529F3C4C.4010000@cern.ch> References: <529F3C4C.4010000@cern.ch> Message-ID: Hi Pavel, Pavel Fiala writes: > Should I change the command somehow to make it compilable or is it a > bug/limitation in XSDe? Yes, this is a limitation in XSD/e support for complex inheritance-by- restriction cases. See this earlier reply to a similar problem for details: http://www.codesynthesis.com/pipermail/xsde-users/2011-July/000405.html In your case the workaround would be to change the type of dataType in myArrayType1_base from arrayDataType to basicDataType. Also, if you have a large number of such case then you may want to consider using XSD's C++/Tree mapping instead. It has much better support for complex schemas. Boris From pavel.fiala at cern.ch Thu Dec 5 03:21:07 2013 From: pavel.fiala at cern.ch (Pavel Fiala) Date: Thu Dec 5 03:21:16 2013 Subject: [xsde-users] Multiple restrictions In-Reply-To: References: <529F3C4C.4010000@cern.ch> Message-ID: <52A03773.8030702@cern.ch> Hi Boris, thank you for confirmation. These values are used from different C++ project so I wanted to keep the structure similar as long as possible. I change the myArrayType1_base Now, it compiles without any error but the fixed value is ignored. The only restriction is the one from basicDataType. I guess it's the same limitation, isn't it? The reasons why I wanted to try XSDe first are probably lower memory usage and build-in serializer. Also, I have to process large files (Xerces DOM takes ~1.7GB of memory) so I would probably go for XSD's C++/parser. Is there tha same limitation in the C++/parser? Otherwise I will have a look at the C++/tree streaming and performance examples. Pavel On 5.12.2013 07:52, Boris Kolpackov wrote: > Hi Pavel, > > Pavel Fiala writes: > >> Should I change the command somehow to make it compilable or is it a >> bug/limitation in XSDe? > Yes, this is a limitation in XSD/e support for complex inheritance-by- > restriction cases. See this earlier reply to a similar problem for > details: > > http://www.codesynthesis.com/pipermail/xsde-users/2011-July/000405.html > > In your case the workaround would be to change the type of dataType > in myArrayType1_base from arrayDataType to basicDataType. > > Also, if you have a large number of such case then you may want to > consider using XSD's C++/Tree mapping instead. It has much better > support for complex schemas. > > Boris From boris at codesynthesis.com Thu Dec 5 06:51:11 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Dec 5 06:53:36 2013 Subject: [xsde-users] Multiple restrictions In-Reply-To: <52A03773.8030702@cern.ch> References: <529F3C4C.4010000@cern.ch> <52A03773.8030702@cern.ch> Message-ID: Hi Pavel, Pavel Fiala writes: > > > > > fixed="64" use="required"/> > > > > > Now, it compiles without any error but the fixed value is ignored. > The only restriction is the one from basicDataType. I guess it's the > same limitation, isn't it? Yes, normally fixed/default values are supported by XSD/e but not in this case. Essentially, XSD/e uses information from the base attribute. > Also, I have to process large files (Xerces DOM takes ~1.7GB of memory) > so I would probably go for XSD's C++/parser. Is there tha same limitation > in the C++/parser? Yes, C++/Parser in XSD and XSD/e use the same architecture. > Otherwise I will have a look at the C++/tree streaming and performance > examples. Yes, the streaming example shows how you can handle very large documents with C++/Tree. Boris