From gisela.giusti at intel.com Mon Jul 11 16:49:42 2011 From: gisela.giusti at intel.com (Giusti, Gisela) Date: Mon Jul 11 16:49:52 2011 Subject: [xsde-users] multiroot + polymorphism Message-ID: <62BFE5680C037E4DA0B0A08946C0933D0153472F2E@rrsmsx506.amr.corp.intel.com> Hi, I am trying to generate code to handle XACML policies with xsd/e. The problem I have is I need to use multiroot and polymorphism at the same time but I couldn't find the way to do it. I know there are examples for using multiroot and also polymorphism but I couldn't get how to mix both. Thanks, Gisela From boris at codesynthesis.com Tue Jul 12 07:29:18 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jul 12 07:31:57 2011 Subject: [xsde-users] multiroot + polymorphism In-Reply-To: <62BFE5680C037E4DA0B0A08946C0933D0153472F2E@rrsmsx506.amr.corp.intel.com> References: <62BFE5680C037E4DA0B0A08946C0933D0153472F2E@rrsmsx506.amr.corp.intel.com> Message-ID: Hi Gisela, Giusti, Gisela writes: > The problem I have is I need to use multiroot and polymorphism at the > same time but I couldn't find the way to do it. I know there are examples > for using multiroot and also polymorphism but I couldn't get how to mix > both. There is the polyroot example for each mapping. I think it shows how to do what you want. Boris From rashij at cybage.com Fri Jul 22 03:06:39 2011 From: rashij at cybage.com (Rashi Jha) Date: Fri Jul 22 06:20:39 2011 Subject: [xsde-users] error "unable to open in read mode" Message-ID: Hi, I am trying to generate C++ classes and parser skeleton through XSD/e for an xsd. That xsd includes three other XSD's. When I run command $ xsde cxx-hybrid --generate-parser --generate-aggregate myxsd.xsd, I get an error saying unable to open the included xsd in read mode. Can any one help me out in finding a solution for this error? Thanks and Regards, Rashi Jha,Software Engineer Cybage Software Pvt. Ltd. (An SEI-CMMI Level 5 assessed & ISO 27001 Company) Pune, India Phone(O):91-20-66041700, Ext:6680 "Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment." www.cybage.com From boris at codesynthesis.com Fri Jul 22 06:23:24 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Jul 22 06:26:04 2011 Subject: [xsde-users] error "unable to open in read mode" In-Reply-To: References: Message-ID: Hi Rashi, Rashi Jha writes: > I am trying to generate C++ classes and parser skeleton through XSD/e > for an xsd. That xsd includes three other XSD's. When I run command > $ xsde cxx-hybrid --generate-parser --generate-aggregate myxsd.xsd, > I get an error saying unable to open the included xsd in read mode. It would be useful to see the file path that XSD/e cannot open. Is it a relative path, absolute, a URL? Filesystem paths in included files are always resolved relative to the location of the file that's doing the inclusion. URL paths are not supported by XSD/e for security reasons. The way to resolve this is to either edit the schema to use the correct relative path, or, if you don't want to change the schemas, use the --location-map XSD/e option to map an incorrect path to the correct one. Boris From rashij at cybage.com Tue Jul 26 05:00:02 2011 From: rashij at cybage.com (Rashi Jha) Date: Wed Jul 27 05:29:40 2011 Subject: [xsde-users] error "unable to open in read mode" In-Reply-To: References: Message-ID: Hi Boris, I was able to generate C++ classes for the file POCD_MT000040.xsd . But now when I add all the files in my project and build the project, I get 4 errors in file POCD_MT000040-pskel.cpp as: 1. error: invalid conversion from 'v3::ED*' to 'v3::thumbnail*' 2 . error: initializing argument 1 of 'virtual void v3::ED_pskel::thumbnail(v3::thumbnail*)' 3. error: 'class v3::cs_pskel' has no member named 'post_TimingEvent' 4. error: no matching function for call to 'v3::EIVL_event_pskel::code(const v3::TimingEvent&)' I do not have much knowledge of C++. Can you please help me in solving the above errors. Regards Rashi -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Friday, July 22, 2011 6:25 PM To: Rashi Jha Subject: Re: [xsde-users] error "unable to open in read mode" Hi Rashi, Can you send me your schemas so that I can try to reproduce this problem? Boris Rashi Jha writes: > Hi Boris, > > Thanks for the suggestion. I tried using --location-map option and now it is taking the path correctly. > But now when I run > $ xsde cxx-hybrid --generate-parser --generate-aggregate > --location-map > ../../processable/coreschemas/datatypes.xsd=datatypes.xsd > --location-map ../../processable/coreschemas/voc.xsd=voc.xsd > --location-map > ../../processable/coreschemas/NarrativeBlock.xsd=NarrativeBlock.xsd > --file-per-type myxsd.xsd > > It gives me an error saying "segmentation fault". Can you help me in providing a solution for this problem? > > > -----Original Message----- > From: Boris Kolpackov [mailto:boris@codesynthesis.com] > Sent: Friday, July 22, 2011 3:53 PM > To: Rashi Jha > Cc: 'xsde-users@codesynthesis.com' > Subject: Re: [xsde-users] error "unable to open in read mode" > > Hi Rashi, > > Rashi Jha writes: > > > I am trying to generate C++ classes and parser skeleton through > > XSD/e for an xsd. That xsd includes three other XSD's. When I run > > command $ xsde cxx-hybrid --generate-parser --generate-aggregate > > myxsd.xsd, I get an error saying unable to open the included xsd in read mode. > > It would be useful to see the file path that XSD/e cannot open. Is it a relative path, absolute, a URL? Filesystem paths in included files are always resolved relative to the location of the file that's doing the inclusion. URL paths are not supported by XSD/e for security reasons. > > The way to resolve this is to either edit the schema to use the correct relative path, or, if you don't want to change the schemas, use the --location-map XSD/e option to map an incorrect path to the correct one. > > Boris > > > "Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment." > www.cybage.com > > "Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment." www.cybage.com From boris at codesynthesis.com Wed Jul 27 05:40:46 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jul 27 05:43:26 2011 Subject: [xsde-users] error "unable to open in read mode" In-Reply-To: References: Message-ID: Hi Rashi, Rashi Jha writes: > I was able to generate C++ classes for the file POCD_MT000040.xsd . But > now when I add all the files in my project and build the project, I get 4 > errors in file POCD_MT000040-pskel.cpp as: > > 1. error: invalid conversion from 'v3::ED*' to 'v3::thumbnail*' > 2 . error: initializing argument 1 of 'virtual void v3::ED_pskel::thumbnail(v3::thumbnail*)' > 3. error: 'class v3::cs_pskel' has no member named 'post_TimingEvent' > 4. error: no matching function for call to 'v3::EIVL_event_pskel::code(const v3::TimingEvent&)' I finally got around to looking into this. First of all, I fixed a couple of problems in XSD/e that has to do with chameleon-style inclusion (used in your schemas). Now I am able to generate the C++ code without any errors or seg faults and any modifications to the schemas. I can build you a pre-release binary with these fixes if you would like (just let me know on which platform you run the XSD/e compiler). However, when compiling the generated code with a C++ compiler, I get exactly the same errors as you showed above. I investigated it further and they are all caused by complex inheritance-by-restriction use cases. In general, inheritance-by-restriction in XML Schema does not map cleanly to C++ inheritance and XSD/e compiler has a limited support for this feature. A work around for this problem is to relax the schema a little bit (if you need, you can "tighten" things back by adding a few checks in your application or by customizing the parser implementations and performing those checks there). So here are the two changes I had to make to allow the generated code to compile successfully: 1. In datatype-base.xsd in type ST line 311, change the thumbnail element definition from: To: 2. In datatype-base.xsd in type EIVL.event line 1690, change the code attribute definition from: To: Boris From rashij at cybage.com Thu Jul 28 02:20:06 2011 From: rashij at cybage.com (Rashi Jha) Date: Thu Jul 28 09:09:31 2011 Subject: [xsde-users] error "unable to open in read mode" In-Reply-To: References: Message-ID: Hi Boris, Thank you very much for taking the time to reply to me. It really helped me. Now the generated classes are compiling successfully. But now I am facing another issue when trying to build the driver for a sample "hello" application as provided in the C++/Hybrid mapping getting started guide. I tried to follow the below steps to compile & build the driver: 1. Built the libxsde.a library using steps mentioned in ios/README - [Done] 2. Created hello.xsd and hello.xml. - [Done] 3. Got driver.o, hello.o, hello-pskel.o, hello-pimpl.o files generated using the driver.cxx file. - [Done] 4. Now when I try to create binary of driver linking .o files using below command: - [Failed] # c++/g++ -o driver driver.o hello.o hello-pskel.o hello-pimpl.o somePathToMyLibxsdeBuildFolder/libxsde.a It gives me error saying architecture missing for x86_64 & vtable specific errors too. I have tried to find if there is any specific macro getting passed but unable to figure out. Will you please help in finding a solution to this? Also, please send me the binary with the fixes that you have made. Please find the error log file in the attachments and details of my Mac. Regards Rashi -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Wednesday, July 27, 2011 3:11 PM To: Rashi Jha Cc: xsde-users@codesynthesis.com; Amit Jain Subject: Re: [xsde-users] error "unable to open in read mode" Hi Rashi, Rashi Jha writes: > I was able to generate C++ classes for the file POCD_MT000040.xsd . > But now when I add all the files in my project and build the project, > I get 4 errors in file POCD_MT000040-pskel.cpp as: > > 1. error: invalid conversion from 'v3::ED*' to 'v3::thumbnail*' > 2 . error: initializing argument 1 of 'virtual void v3::ED_pskel::thumbnail(v3::thumbnail*)' > 3. error: 'class v3::cs_pskel' has no member named 'post_TimingEvent' > 4. error: no matching function for call to 'v3::EIVL_event_pskel::code(const v3::TimingEvent&)' I finally got around to looking into this. First of all, I fixed a couple of problems in XSD/e that has to do with chameleon-style inclusion (used in your schemas). Now I am able to generate the C++ code without any errors or seg faults and any modifications to the schemas. I can build you a pre-release binary with these fixes if you would like (just let me know on which platform you run the XSD/e compiler). However, when compiling the generated code with a C++ compiler, I get exactly the same errors as you showed above. I investigated it further and they are all caused by complex inheritance-by-restriction use cases. In general, inheritance-by-restriction in XML Schema does not map cleanly to C++ inheritance and XSD/e compiler has a limited support for this feature. A work around for this problem is to relax the schema a little bit (if you need, you can "tighten" things back by adding a few checks in your application or by customizing the parser implementations and performing those checks there). So here are the two changes I had to make to allow the generated code to compile successfully: 1. In datatype-base.xsd in type ST line 311, change the thumbnail element definition from: To: 2. In datatype-base.xsd in type EIVL.event line 1690, change the code attribute definition from: To: Boris "Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment." www.cybage.com -------------- next part -------------- A non-text attachment was scrubbed... Name: errorLog.rtf Type: application/rtf Size: 48892 bytes Desc: errorLog.rtf Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20110728/e17c5354/errorLog-0001.rtf -------------- next part -------------- MAC OS X Version - 10.6.5 SDKs: Mac OS X: 10.5: (9L31a) 10.6: (10M2423) iPhone OS: 4.2: (8C134) iPhone Simulator: 3.2: (7W367a) 4.0: (8A400) 4.1: (8B117) 4.2: (8C134) Compiler versions tried: XXXX-Mac-mini:Classes rashij$ c++ -version i686-apple-darwin10-g++-4.2.1: no input files XXXX-Mac-mini:Classes rashij$ g++ -version i686-apple-darwin10-g++-4.2.1: no input files XXXX-Mac-mini:Classes rashij$ uname -a Darwin XXXX-Mac-mini.local 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386 From rashij at cybage.com Thu Jul 28 10:37:27 2011 From: rashij at cybage.com (Rashi Jha) Date: Fri Jul 29 08:18:22 2011 Subject: [xsde-users] error "unable to open in read mode" In-Reply-To: References: Message-ID: Hi Boris, I have made certain improvements in getting the driver compile & build at my end. I tried to follow the below steps for getting my driver class code run successfully : 1. Added generated C++ files for hello sample to my project. 2. Added libxsde.a library to my libraries. 3. Provided path to the libxsde folder in the header search paths option under Build tab. When I built the project in XCode(IDE), it ran successfully and printed the output in debugger as: [Session started at 2011-07-28 19:41:04 +0530.] In Driver Main Hello, sun! Hello, moon! Hello, world! But when I try to get the same output through terminal via below command, it gives me output as below: # Mac-mini:Build rashij$ ./Debug-iphonesimulator/HelloCodeSynthesis.app/HelloCodeSynthesis ./Debug-iphonesimulator/HelloCodeSynthesis.app/hello.xml dyld: Library not loaded: /System/Library/Frameworks/UIKit.framework/UIKit Referenced from: /Users/rashij/HelloCodeSynthesis/Build/./Debug-iphonesimulator/HelloCodeSynthesis.app/HelloCodeSynthesis Reason: image not found Trace/BPT trap Mac-mini:Build rashij$ Problem in my XSD generated C++ files: When trying to create the driver.cxx file for my schema, I found that the parser aggregate classes were not being generated in implementation file. While, the aggregate class is getting generated for hello.xsd's hello-pimpl.h generated file. Will you please let me know if the parser aggregate class in the implementation file is getting generated at your end? I am not able to find as to why are the aggregate classes not getting generated for my XSD's global elements. Looking forward to your reply. Regards Rashi -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Wednesday, July 27, 2011 3:11 PM To: Rashi Jha Cc: xsde-users@codesynthesis.com; Amit Jain Subject: Re: [xsde-users] error "unable to open in read mode" Hi Rashi, Rashi Jha writes: > I was able to generate C++ classes for the file POCD_MT000040.xsd . > But now when I add all the files in my project and build the project, > I get 4 errors in file POCD_MT000040-pskel.cpp as: > > 1. error: invalid conversion from 'v3::ED*' to 'v3::thumbnail*' > 2 . error: initializing argument 1 of 'virtual void v3::ED_pskel::thumbnail(v3::thumbnail*)' > 3. error: 'class v3::cs_pskel' has no member named 'post_TimingEvent' > 4. error: no matching function for call to 'v3::EIVL_event_pskel::code(const v3::TimingEvent&)' I finally got around to looking into this. First of all, I fixed a couple of problems in XSD/e that has to do with chameleon-style inclusion (used in your schemas). Now I am able to generate the C++ code without any errors or seg faults and any modifications to the schemas. I can build you a pre-release binary with these fixes if you would like (just let me know on which platform you run the XSD/e compiler). However, when compiling the generated code with a C++ compiler, I get exactly the same errors as you showed above. I investigated it further and they are all caused by complex inheritance-by-restriction use cases. In general, inheritance-by-restriction in XML Schema does not map cleanly to C++ inheritance and XSD/e compiler has a limited support for this feature. A work around for this problem is to relax the schema a little bit (if you need, you can "tighten" things back by adding a few checks in your application or by customizing the parser implementations and performing those checks there). So here are the two changes I had to make to allow the generated code to compile successfully: 1. In datatype-base.xsd in type ST line 311, change the thumbnail element definition from: To: 2. In datatype-base.xsd in type EIVL.event line 1690, change the code attribute definition from: To: Boris "Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment." www.cybage.com From boris at codesynthesis.com Fri Jul 29 08:27:46 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Jul 29 08:30:25 2011 Subject: [xsde-users] error "unable to open in read mode" In-Reply-To: References: Message-ID: Hi Rashi, Rashi Jha writes: > I have made certain improvements in getting the driver compile & build > at my end. You previous problem (missing x86_64 architecture in libxsde.a) was most likely due to you trying to link a libxsde.a that was built for an iOS simulator or device to a program that is a Mac OS X executable. When you invoke c++ or g++ on the command line, they compile for Mac OS X, not iOS. > When I built the project in XCode(IDE), it ran successfully and printed > the output in debugger as: > > [Session started at 2011-07-28 19:41:04 +0530.] > In Driver Main > Hello, sun! > Hello, moon! > Hello, world! > > But when I try to get the same output through terminal via below command, > it gives me output as below: > > # Mac-mini:Build rashij$ ./Debug-iphonesimulator/HelloCodeSynthesis.app/ > HelloCodeSynthesis ./Debug-iphonesimulator/HelloCodeSynthesis.app/hello.xml > > dyld: Library not loaded: /System/Library/Frameworks/UIKit.framework/UIKit It seems that the XCode iOS simulator binaries depend of shared libraries that are not in the default library search path. I don't think Apple supports running iOS simulator applications from the command line. > Problem in my XSD generated C++ files: When trying to create the > driver.cxx file for my schema, I found that the parser aggregate > classes were not being generated in implementation file. > > I am not able to find as to why are the aggregate classes not getting > generated for my XSD's global elements. The only global element that I see is defined in CDA.xsd. Have you compiled that schema? Boris