From boris at codesynthesis.com Mon Sep 1 03:06:47 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Sep 1 03:12:46 2014 Subject: [xsd-users] Serialization of inherited class not providing attributes from base class In-Reply-To: <1409320552.27296.87.camel@localhost> References: <1409320552.27296.87.camel@localhost> Message-ID: Hi Roger roger writes: > When I serialize the invoice, I only get: > NOK > > instead of the expected: > listID="ISO4217">NOK > > Can this have to do with the fact that two of the base classes have the > same name, or is it maybe that the inheritance chain is too long? I don't think it is any of those. My first guess would be that the type is polymorphic. This is #1 cause for missing content during serialization. Check if cbc:DocumentCurrencyCode is a member of a substitution group (or should have xsi:type attribute in the document). If that's not it, then you may want to try to upgrade to XSD 4.0.0 and see if that helps. Let me know if none of this helps in which case I will have to look deeper into this. Boris From boris at codesynthesis.com Tue Sep 2 06:33:42 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Sep 2 06:40:00 2014 Subject: [xsd-users] Error report for XSD-4.0 In-Reply-To: References: Message-ID: Hi Alexander, [I've CC'ed xsd-users to my reply since other might run into a similar issue.] alexander.gosling@kongsberg.com writes: > We have done some testing on different version of XSD and on different > platforms. > > On Windows it is only in XSD version 4.0 it fails. It is correct for > version 3.3.0. > > On Linux it works on both versions: 4.0 and 3.3.0. > > For us it seems that there must be something wrong/strange with the > xsd.exe version 4.0 for Windows. Ok, I've figured out what the problem is. Starting with 4.0.0, XSD now always uses canonical paths on each platform. That is, on POSIX it will be /foo/bar while on Windows it will be c:\foo\bar. Specifically, on Windows the path will always use back-slashes (\) even if you specified (some) of them using forward slashes. So the first change that I've made to your options file is to match both kind of slashes: --include-regex %.*[\\/]schemas[\\/](.+)%Jade/OpenGIS/$1% --include-regex %.*Common[\\/](.+)%Jade/OpenGIS/Common/$1% This only fixed the problem partially. Now the include directive looks like this (note the wrong last slash): #include Unfortunately there is no elegant way to fix this last slash other than by splitting the path into components and then re-assembling it with the correct slashes. I checked and in your case you can have maximum there components after schemas/ so we need three options (note that the order is important): --include-regex %.*[\\/]schemas[\\/](.+)%Jade/OpenGIS/$1% --include-regex %.*[\\/]schemas[\\/](.+)[\\/](.+)%Jade/OpenGIS/$1/$2% --include-regex %.*[\\/]schemas[\\/](.+)[\\/](.+)[\\/](.+)%Jade/OpenGIS/$1/$2/$3% --include-regex %.*Common[\\/](.+)%Jade/OpenGIS/Common/$1% With this fix I get the correct include directive: #include Boris From cxie at qti.qualcomm.com Mon Sep 8 16:49:20 2014 From: cxie at qti.qualcomm.com (Xie, Chunying) Date: Mon Sep 8 23:29:01 2014 Subject: [xsd-users] Q: how to fill out any_sequence Message-ID: <0ada77bc22a0453caecd04f9f8243437@NASANEXM01H.na.qualcomm.com> Hi, Boris: I got your email from my colleague Ravi (raviraja@qti.qualcomm.com), who contacted you earlier this year. I have xsd from RFC 4575 for conference event. In the user-type part, there is a user-defined element after endpoint that I need to fill in. The xsd looks like the following. The element name is "etype" with value as string value. I had a lot of trouble filling in this field once it is translated into C++ code as the following: typedef ::xsd::cxx::tree::element_sequence any_sequence; typedef any_sequence::iterator any_iterator; typedef any_sequence::const_iterator any_const_iterator; const any_sequence& any () const; any_sequence& any (); void any (const any_sequence& s); Per definition, the it can be any element from any namespace if I am not mistaken. Do I need to create a new namespace for this new element. How I am to fill in any_sequence/element_sequence. I am wondering if you have some sample code that I can mirror with, since I have been googling around without finding anything useful. Really appreciate your help. Chunying Xie Qualcomm Inc 5775 Morehouse Drive San Diego, CA 92121 From boris at codesynthesis.com Mon Sep 8 23:50:29 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Sep 8 23:47:27 2014 Subject: [xsd-users] Q: how to fill out any_sequence In-Reply-To: <0ada77bc22a0453caecd04f9f8243437@NASANEXM01H.na.qualcomm.com> References: <0ada77bc22a0453caecd04f9f8243437@NASANEXM01H.na.qualcomm.com> Message-ID: Hi Chunying, Xie, Chunying writes: > How I am to fill in any_sequence/element_sequence. I am wondering if you > have some sample code that I can mirror [...] Take a look at the 'wildcard' example in the examples/cxx/tree/ directory that comes with the XSD distribution. It shows how to do exactly that. Also, Section 2.12, "Mapping for any and anyAttribute" in the C++/Tree mapping manual has quite a bit of information: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.12 Boris From timothy.astle at caris.com Thu Sep 4 11:11:50 2014 From: timothy.astle at caris.com (Timothy Astle) Date: Mon Sep 8 23:57:46 2014 Subject: [xsd-users] Visitors (again?) Message-ID: <54088136.1000904@caris.com> I've checked the list archives aboutthis andseen a few related threads, but I'd like to get a summary / update. It seems like I'mnot the first one interested in this topic. Also keep in mind that I'm new to this library, so please be kind. :) Is there any means to generate sourcethat allows for visitors? Similar to what we're adding to the OGC Sche mas in JAXB . There are situations where we'd like to take OGC Filters andtraverse them to produce queries. If someone can point me in the right direction, it'd be much appreciated. Cheers, Tim -- Tim Astle Development Manager Web Technologies *CARIS* 115 Waggoners Lane Fredericton, New Brunswick Canada E3B 2L4 Tel: +1.506.458.8533 Fax: +1.506.459.3849 www.caris.com *Connect with CARIS* Twitter | LinkedIn | Facebook | Google+ | YouTube Download your free copy of CARIS Easy View today! www.caris.com/easyview _________________________________________________________________________ This email and any files transmitted with it are confidential and intended only for the addressee(s). If you are not the intended recipient(s) please notify us by email reply. You should not use, disclose, distribute or copy this communication if received in error. Any views or opinions expressed in this email are solely those of the author and do not necessarily represent those of the company. No binding contract will result from this email until such time as a written document is signed on behalf of the company. From xsd-users at oli-obk.de Tue Sep 9 02:58:09 2014 From: xsd-users at oli-obk.de (Oliver Schneider) Date: Tue Sep 9 02:58:12 2014 Subject: [xsd-users] Visitors (again?) In-Reply-To: <54088136.1000904@caris.com> References: <54088136.1000904@caris.com> Message-ID: <540EA501.5050105@oli-obk.de> Hi Tim, You can easily add a visit function to all your custom classes. look at http://wiki.codesynthesis.com/Tree/Customization_guide#Customizing_the_generated_type_.E2.80.94_the_complex_case Then add a void accept(Visitor& v) { v.visit(*this); } function. If you have c++11 you can even easily templatize this (can be done w/o c++11, but the inclusion of the template would be a mess) I created a Visitable template: template