From soroush.rabiei at gmail.com Mon Jun 2 03:56:45 2014 From: soroush.rabiei at gmail.com (Soroush Rabiei) Date: Mon Jun 2 03:57:13 2014 Subject: [xsd-users] xsd-generated code ignores attributes In-Reply-To: References: Message-ID: On Wed, May 28, 2014 at 12:42 PM, Boris Kolpackov wrote: > > To understand why name() is not called, check the signature of that > function in presentation_t_pskel and make sure that it matches what > you have in XPresentationParser. > > Boris > I noticed that I've forgotten to add string and positive integer parsers in parser construction API. (I never call .parsers method, but add each parser by it's own function) I expected xsd API to use default parsers for simple types. From xavier.mirabel at altran.com Wed Jun 4 13:43:58 2014 From: xavier.mirabel at altran.com (MIRABEL Xavier) Date: Thu Jun 5 04:08:39 2014 Subject: [xsd-users] Error when generating code from standard FMI xsd files v2.0 Message-ID: Skipped content of type multipart/related-------------- next part -------------- A non-text attachment was scrubbed... Name: XSD.zip Type: application/x-zip-compressed Size: 16695 bytes Desc: XSD.zip Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20140604/d8891005/XSD-0001.bin From boris at codesynthesis.com Thu Jun 5 04:21:11 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jun 5 04:18:34 2014 Subject: [xsd-users] Error when generating code from standard FMI xsd files v2.0 In-Reply-To: References: Message-ID: Hi Xavier, In the future please don't embed screenshots of your problems into emails you send to the mailing list, as described in the posting guidelines: http://codesynthesis.com/support/posting-guidelines.xhtml MIRABEL Xavier writes: > 1> XSD\fmiType.xsd:51:= 29: error: element name 'fmiSimpleType/Real' > creates an unstable conflict w= hen used as a type name > > 1> XSD\fmiScalarVariab= le.xsd:54:22: info: conflicting type is > defined here > > 1> XSD\fmiType.xsd:51:= 29: info: use --anonymous-regex to resolve > this conflict Well, as the diagnostics suggests, you can use the --anonymous-regex option to resolve this. The option is described in the XSD compiler command line manual (man pages): http://codesynthesis.com/projects/xsd/documentation/xsd.xhtml For example, you could use this variant: --anonymous-regex "#.* .* (.+)/(.+)#\1\2#" Boris From gordan.sikic at uljanik.hr Thu Jun 5 06:46:18 2014 From: gordan.sikic at uljanik.hr (Gordan Sikic) Date: Thu Jun 5 06:46:27 2014 Subject: [xsd-users] Double definitions when using DLLs In-Reply-To: References: Message-ID: <53904A7A.1060104@uljanik.hr> For the sake of completeness: We had same problem, but original suggestion to make one DLL "root" was not an option. On the other hand, we built and linked everything if instead of exporting complete classes, member functions are exported (i.e. decorated with dllimport/dllexport). All those linking problems wanished. Of course, since it is automatically generated code, we were faced with new problem, a new precompile step was needed, in order to rearrange decorations. It was done using gccxml. so there is definitely another way to solve the problem. best regards, Gordan On 13.5.2014. 5:35, Boris Kolpackov wrote: > Hi Alexander, > > alexander.gosling@kongsberg.com writes: > >> Are there any plans to fix this more permanently? > > This is really a problem in the MS toolchain. Essentially, with VC++ it > is impossible to derive from std::string if DLLs are used. > > Unfortunately there is no easy way to work around this problem from > our side. The "permanent" way to fix this would be to stop deriving > from std::string. But that would also remove fairly useful > functionality: right now one can pass xml_schema::string (or any > other string-based type) to an interface that expects std::string > and everything will work out of the box. Removing this functionality > for everyone just because Microsoft's toolchain is broken seems like > a bad idea. > > Note also that it is already possible to customize the xs:string type > and provide your own implementation without inheritance. Maybe providing > a custom implementation like this and instructions that describe how to > set everything up would be sufficient? > > Boris > > The information in this email is confidential and it is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any distribution, copying, duplication or disclosure is prohibited and may be unlawful. If you have received this email in error, please notify the sender immediately and destroy it, and all copies of it. Ova poruka je povjerljiva i namijenjena isklju?ivo primateljima navedenim u zaglavlju iste. Svaki pristup, distribucija, umno?avanje ili otkrivanje sadr?aja ove poruke tre?im osobama strogo je zabranjeno i smatra se protuzakonitim. Ukoliko ste gre?kom dobili ovu poruku, molimo Vas da ?to prije obavijestite po?iljatelja poruke i uni?tite sve postoje?e kopije. From boris at codesynthesis.com Fri Jun 6 06:12:46 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Jun 6 06:10:11 2014 Subject: [xsd-users] Double definitions when using DLLs In-Reply-To: <53904A7A.1060104@uljanik.hr> References: <53904A7A.1060104@uljanik.hr> Message-ID: Hi Gordan, Gordan Sikic writes: > On the other hand, we built and linked everything if instead of > exporting complete classes, member functions are exported (i.e. > decorated with dllimport/dllexport). All those linking problems > wanished. Yes, that would be another approach, if very verbose. Thanks for sharing. Boris From rlischner at proteuseng.com Mon Jun 9 10:27:53 2014 From: rlischner at proteuseng.com (Ray Lischner) Date: Mon Jun 9 11:33:23 2014 Subject: [xsd-users] polymorphic comparison Message-ID: <68F9DD51BF61E943BFA45D744048A7A7319D719A00@nbp-ex01.proteus-technologies.com> I recently ran into a situation in which I want to compare two objects for equality, but all I have are pointers to xsd::cxx::tree::type. That is, I need polymorphic comparison to check whether they have the same type, and if so, check whether the members are the same. Ray Lischner, Distinguished Member of Technical Staff 133 National Business Pkwy, Ste 150 t. 443.539.3448 Annapolis Junction, MD 20701 c. 301.377.7668 rlischner@proteuseng.com f. 443.539.3370 From seankaner at amewas.com Mon Jun 9 13:52:07 2014 From: seankaner at amewas.com (Sean Kaner) Date: Mon Jun 9 15:05:48 2014 Subject: [xsd-users] compression code generation Message-ID: Hello, I was exploring the cxx tree compression example, but from the example it's not clear how the generated code was generated. Specifically the example has generated code that can parse "xercesc::InputSource" it's a parsing parameter in the generated code. In trying to do my own example and generate my own code, I can't seem to find what command line options I need to use in order to have the generated code support parsing "xercesc::InputSource" I'm currently generating the code using these options "xsd cxx-tree --generate-serialization --generate-default-ctor --namespace-map..... myFile.xsd" Unfortunately it has no support for parsing "xercesc::InputSource" and the compression example itself starts with the code already generated so I don't know how it was generated. Can you please show how the generated code was generated for the compression example? Thanks From boris at codesynthesis.com Tue Jun 10 08:37:53 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jun 10 08:36:28 2014 Subject: [xsd-users] compression code generation In-Reply-To: References: Message-ID: Hi Sean, Sean Kaner writes: > Unfortunately it has no support for parsing "xercesc::InputSource" [...] What you are looking for is a parsing function that accepts InputSource. You always get a complete set, including the one that you want, so what most likely happens is that the parsing function is not generated altogether. XSD by default will generates parsing functions for every global element in your schema (in the compression example that element is 'catalog', defined right at the end of the schema). So the first thing to check is that you actually have any global elements. You can also read more on things related to parsing functions in Chapter 3, "Parsing", in the C++/Tree Mapping User Manual: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#3 Boris From boris at codesynthesis.com Tue Jun 10 08:49:06 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jun 10 08:46:29 2014 Subject: [xsd-users] polymorphic comparison In-Reply-To: <68F9DD51BF61E943BFA45D744048A7A7319D719A00@nbp-ex01.proteus-technologies.com> References: <68F9DD51BF61E943BFA45D744048A7A7319D719A00@nbp-ex01.proteus-technologies.com> Message-ID: Hi Ray, Ray Lischner writes: > I recently ran into a situation in which I want to compare two objects > for equality, but all I have are pointers to xsd::cxx::tree::type. That > is, I need polymorphic comparison to check whether they have the same > type, and if so, check whether the members are the same. If the actual types are polymorphic, then: #include xml_schema::type& x = ... xml_schema::type& y = ... xsd::cxx::tree::comparison_map& cm ( xsd::cxx::tree::comparison_map_instance<0, char> ()); bool result (cm.compare (x, y)); Boris From vladimir.zykov at ncloudtech.ru Thu Jun 19 10:05:00 2014 From: vladimir.zykov at ncloudtech.ru (Vladimir Zykov) Date: Thu Jun 19 10:29:34 2014 Subject: [xsd-users] Incorrect parsing of unqualified attributes in schema with qualified attributes Message-ID: Hi Boris, We encountered a problem with XSD 4.0.0.a14. For the attached schema it generates wrong code for parsing attributes from imported schema with attributeFormDefault=?unqualified? while the importing schema has attributeFormDefault=?qualified?. For example, the following XML is correct with respect to schema files from the attachments. However, when we run xsd like this: ./xsd cxx-tree --file-per-type s1.xsd s2.xsd s3.xsd the generated function parse() for type A assumes that attribute ?a? must be qualified and thus the above XML is not valid since attribute ?a? has empty namespace. There is another inconsistency. When we run xsd without --file-per-type then generated parse() expects attribute ?a? without namespace and this seems to be correct. Thanks -------------- next part -------------- A non-text attachment was scrubbed... Name: xsd.tgz Type: application/octet-stream Size: 538 bytes Desc: xsd.tgz Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20140619/5fde38f0/xsd.obj -------------- next part --------------

Vladimir Zykov
Software Engineer
New Cloud Technologies, LLC


From boris at codesynthesis.com Fri Jun 20 07:49:31 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Jun 20 07:53:55 2014 Subject: [xsd-users] Incorrect parsing of unqualified attributes in schema with qualified attributes In-Reply-To: References: Message-ID: Hi Vladimir, Fixed, thanks for the report and the test case! The patch is quite simple in case you would like to apply it to 4.0.0.a14: http://scm.codesynthesis.com/?p=libxsd-frontend/libxsd-frontend.git;a=blobdiff;f=xsd-frontend/parser.cxx;h=2c090d5907f5d48292fbdac69fdc3e89e161cd27;hp=d0df805efc9cc050036c8881d8b972055bfb2f29;hb=f2950befcea5e40d43a59241e5df88ac8f8cb53d;hpb=1e5aa9305f310fa7426a320f4f06a7701cabfcdb Alternatively I can package you a new version. Boris From vladimir.zykov at ncloudtech.ru Fri Jun 20 12:31:53 2014 From: vladimir.zykov at ncloudtech.ru (Vladimir Zykov) Date: Mon Jun 23 02:59:55 2014 Subject: [xsd-users] Incorrect parsing of unqualified attributes in schema with qualified attributes In-Reply-To: References: Message-ID: <3270FFB6-A81E-425B-8BA1-9FE4F3A2A27B@ncloudtech.ru> Thanks Boris, the problem is fixed. On Jun 20, 2014, at 2:49 PM, Boris Kolpackov > wrote: Hi Vladimir, Fixed, thanks for the report and the test case! The patch is quite simple in case you would like to apply it to 4.0.0.a14: http://scm.codesynthesis.com/?p=libxsd-frontend/libxsd-frontend.git;a=blobdiff;f=xsd-frontend/parser.cxx;h=2c090d5907f5d48292fbdac69fdc3e89e161cd27;hp=d0df805efc9cc050036c8881d8b972055bfb2f29;hb=f2950befcea5e40d43a59241e5df88ac8f8cb53d;hpb=1e5aa9305f310fa7426a320f4f06a7701cabfcdb Alternatively I can package you a new version. Boris Vladimir Zykov Software Engineer New Cloud Technologies, LLC