From jan.klimke at hpi.uni-potsdam.de Mon Nov 3 03:59:56 2008 From: jan.klimke at hpi.uni-potsdam.de (Jan Klimke) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Problems linking Code which uses XSD in Release mode Message-ID: <490EBD8C.60900@hpi.uni-potsdam.de> Hi, i got a pretty strange problem when linking my classes which are using the generated code. When i link in Debug mode everything is working fine, but when i switch to release mode xsd related errors occur. An example for such an error can be found afterwards. It seems that some string related functions can not be found. does anybody have a hint for me solving this issue ? Error 2 error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall xsd::cxx::tree::ncname > > > > >::~ncname > > > > >(void)" (__imp_??1?$ncname@DV?$name@DV?$token@DV?$normalized_string@DV?$string@DV?$simple_type@V_type@tree@cxx@xsd@@@tree@cxx@xsd@@@tree@cxx@xsd@@@tree@cxx@xsd@@@tree@cxx@xsd@@@tree@cxx@xsd@@@tree@cxx@xsd@@UAE@XZ) referenced in function "public: virtual __thiscall xsd::cxx::tree::id > > > > > >::~id > > > > > >(void)" (??1?$id@DV?$ncname@DV?$name@DV?$token@DV?$normalized_string@DV?$string@DV?$simple_type@V_type@tree@cxx@xsd@@@tree@cxx@xsd@@@tree@cxx@xsd@@@tree@cxx@xsd@@@tree@cxx@xsd@@@tree@cxx@xsd@@@tree@cxx@xsd@@@tree@cxx@xsd@@UAE@XZ) collaborationclient.obj Thanks, Jan From boris at codesynthesis.com Mon Nov 3 04:20:51 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Problems linking Code which uses XSD in Release mode In-Reply-To: <490EBD8C.60900@hpi.uni-potsdam.de> References: <490EBD8C.60900@hpi.uni-potsdam.de> Message-ID: <20081103092051.GA14865@karelia> Hi Jan, Jan Klimke writes: > i got a pretty strange problem when linking my classes which are using > the generated code. When i link in Debug mode everything is working > fine, but when i switch to release mode xsd related errors occur. An > example for such an error can be found afterwards. It seems that some > string related functions can not be found. does anybody have a hint for > me solving this issue ? The two errors you showed involve destructors. The interesting thing is that the first (~ncname) is implicit (i.e., it is generated by the C++ compiler). I also see __declspec which tells me DLLs are probably involved. Another interesting thing is that ncname and id class templates don't have __declspec specifiers so I am not sure why they appear in the symbols. Can you describe your setup in a bit more detail? Things like where is the generated code residing (DLL vs executable) and when do you get link errors (e.g., when linking the executable or DLL). Also, if you could provide a test project that reproduces this problem then I could take a look and see if I can find what's going on. Feel free to send it to me directly if you would like to keep your code private. Boris From jan.klimke at hpi.uni-potsdam.de Mon Nov 3 08:33:54 2008 From: jan.klimke at hpi.uni-potsdam.de (Jan Klimke) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Problems linking Code which uses XSD in Release mode In-Reply-To: <20081103092051.GA14865@karelia> References: <490EBD8C.60900@hpi.uni-potsdam.de> <20081103092051.GA14865@karelia> Message-ID: <490EFDC2.4090201@hpi.uni-potsdam.de> Hi Boris, here are some information about my solution setup. I put all files generated by the xsd compiler into a separate DLL-project. Another DLL should use the library. When linking this library in release mode the error occurs. An example project is a bit hard to create due to the dependencies of the libraries. So you won't be able to compile the whole project. Is it sufficient to send it to you like this ? Despite of that i am wondering why linking works when building in debug mode. Jan Boris Kolpackov schrieb: > Hi Jan, > > Jan Klimke writes: > > >> i got a pretty strange problem when linking my classes which are using >> the generated code. When i link in Debug mode everything is working >> fine, but when i switch to release mode xsd related errors occur. An >> example for such an error can be found afterwards. It seems that some >> string related functions can not be found. does anybody have a hint for >> me solving this issue ? >> > > The two errors you showed involve destructors. The interesting > thing is that the first (~ncname) is implicit (i.e., it is > generated by the C++ compiler). I also see __declspec which > tells me DLLs are probably involved. Another interesting thing > is that ncname and id class templates don't have __declspec > specifiers so I am not sure why they appear in the symbols. > > Can you describe your setup in a bit more detail? Things like > where is the generated code residing (DLL vs executable) and > when do you get link errors (e.g., when linking the executable > or DLL). Also, if you could provide a test project that reproduces > this problem then I could take a look and see if I can find > what's going on. Feel free to send it to me directly if you > would like to keep your code private. > > Boris > From jan.klimke at hpi.uni-potsdam.de Tue Nov 4 04:22:58 2008 From: jan.klimke at hpi.uni-potsdam.de (Jan Klimke) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Problems linking Code which uses XSD in Release mode In-Reply-To: <490EFDC2.4090201@hpi.uni-potsdam.de> References: <490EBD8C.60900@hpi.uni-potsdam.de> <20081103092051.GA14865@karelia> <490EFDC2.4090201@hpi.uni-potsdam.de> Message-ID: <49101472.5070204@hpi.uni-potsdam.de> I found out that the usage of the Qname Type causes the linker error. When i am using a line like this: xml_schema::Qname("coll:UriComment") Outside the DLL which contains the generated code the mentioned linker error occurs. When using these classes inside the library everything works fine. For not reproducing the xml_schema Type definitions i generated a separate file for that using the follwing xsd options: --generate-polymorphic --root-element-all --generate-serialization --generate-inline --generate-doxygen --export-symbol WFS_API --hxx-suffix .h --cxx-suffix .cpp --ixx-suffix .inl --include-with-brackets --include-prefix wfs/ --hxx-prologue-file ../headerprologue.txt --type-naming java --function-naming java --generate-forward --generate-xml-schema xml_schema.xsd Is it possible that those Types are not exported in certain cases or the code is optimized away when linking in release mode !? Jan Jan Klimke schrieb: > Hi Boris, > > here are some information about my solution setup. > > I put all files generated by the xsd compiler into a separate DLL-project. > Another DLL should use the library. When linking this library in release > mode the error occurs. An example project is a bit hard to create due to > the dependencies of the libraries. So you won't be able to compile the > whole project. Is it sufficient to send it to you like this ? > > Despite of that i am wondering why linking works when building in debug > mode. > > Jan > > Boris Kolpackov schrieb: > >> Hi Jan, >> >> Jan Klimke writes: >> >> >> >>> i got a pretty strange problem when linking my classes which are using >>> the generated code. When i link in Debug mode everything is working >>> fine, but when i switch to release mode xsd related errors occur. An >>> example for such an error can be found afterwards. It seems that some >>> string related functions can not be found. does anybody have a hint for >>> me solving this issue ? >>> >>> >> The two errors you showed involve destructors. The interesting >> thing is that the first (~ncname) is implicit (i.e., it is >> generated by the C++ compiler). I also see __declspec which >> tells me DLLs are probably involved. Another interesting thing >> is that ncname and id class templates don't have __declspec >> specifiers so I am not sure why they appear in the symbols. >> >> Can you describe your setup in a bit more detail? Things like >> where is the generated code residing (DLL vs executable) and >> when do you get link errors (e.g., when linking the executable >> or DLL). Also, if you could provide a test project that reproduces >> this problem then I could take a look and see if I can find >> what's going on. Feel free to send it to me directly if you >> would like to keep your code private. >> >> Boris >> >> > > From boris at codesynthesis.com Tue Nov 4 05:03:11 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Problems linking Code which uses XSD in Release mode In-Reply-To: <49101472.5070204@hpi.uni-potsdam.de> References: <490EBD8C.60900@hpi.uni-potsdam.de> <20081103092051.GA14865@karelia> <490EFDC2.4090201@hpi.uni-potsdam.de> <49101472.5070204@hpi.uni-potsdam.de> Message-ID: <20081104100311.GA17545@karelia> Hi Jan, Jan Klimke writes: > I found out that the usage of the Qname Type causes the linker error. > When i am using a line like this: > xml_schema::Qname("coll:UriComment") > Outside the DLL which contains the generated code the mentioned linker > error occurs. When using these classes inside the library everything > works fine. I tried to reproduce this with a test case but had no luck so far. Could you try it and see if you get any errors? The test case is here: http://www.codesynthesis.com/~boris/tmp/dlltest.zip It includes project/solution files for VC++ 8. It also uses the rules files that are shipped with XSD for compiling the schema so you may need to add a few paths in the VC++ IDE as described here: http://wiki.codesynthesis.com/Using_XSD_with_Microsoft_Visual_Studio#Visual_Studio_2005_.288.0.29_and_2008_.289.0.29 The test is based on the library example. I've added a QName attribute to the schema (DLL) as well as an instantiation of xml_schema::qname object in the driver (executable). If you don't get any errors either then you can try to figure out what is different between the test and your project. If you manage to reproduce the error in the test case, please let me know. Boris From ildar.farkhshatov at db.com Wed Nov 5 08:35:28 2008 From: ildar.farkhshatov at db.com (Ildar Farkhshatov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Parsing issue Message-ID: Hi all, I've got an issue when parsing XML Euro 1.0 1 NY 2008-11-29T00:00:00 2008-11-12T00:00:00 2008-11-14T00:00:00 JPY USD USD USD EffectiveDate is not a part of FxEuroOpt and should be ignored, however, I am receiving expected_element< char > ( "ExpiryDate", "") exception, which seems to be incorrect, as XML standard states that unknown elements should be ignored. Best Regards, Ildar --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures. From boris at codesynthesis.com Wed Nov 5 09:00:04 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Parsing issue In-Reply-To: References: Message-ID: <20081105140004.GA26049@karelia> Hi Ildar, Ildar Farkhshatov writes: > > Euro > 1.0 > 1 > NY > 2008-11-29T00:00:00 > 2008-11-12T00:00:00 > 2008-11-14T00:00:00 > > JPY > USD > > USD > USD > > > EffectiveDate is not a part of FxEuroOpt and should be ignored, however, I > am receiving > expected_element< char > ( > "ExpiryDate", > "") > > exception, which seems to be incorrect, as XML standard states that > unknown elements should be ignored. When XML Schema validation is involved, it is hard to say whether a particular element can be ignored or not without seeing the corresponding schema fragment. There are also ways to disable XML Schema validation but that depends on which mapping you are using (C++/Tree or C++/Parser). If you can let me know which mapping it is, I can give you some pointers on how to turn validation off. Boris From ildar.farkhshatov at db.com Wed Nov 5 09:43:10 2008 From: ildar.farkhshatov at db.com (Ildar Farkhshatov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Parsing issue In-Reply-To: <20081105140004.GA26049@karelia> Message-ID: Here is the schema: I am using default C++\Tree parser and turned off the validation. I looked into parsing code: this->::Product::parse (p, f); for (; p.more_elements (); p.next_element ()) { /// fields // when field is successfully parsed, the block calls continue; // otherwise it hits break; below meaning that after it reaches EffectiveDate xml entry with no appropriate class-field for it - it stops the parsing break; } Best Regards, Ildar. Boris Kolpackov 11/05/2008 05:00 PM To Ildar Farkhshatov/db/dbcom@DBEMEA cc xsd-users@codesynthesis.com Subject Re: [xsd-users] Parsing issue Hi Ildar, Ildar Farkhshatov writes: > > Euro > 1.0 > 1 > NY > 2008-11-29T00:00:00 > 2008-11-12T00:00:00 > 2008-11-14T00:00:00 > > JPY > USD > > USD > USD > > > EffectiveDate is not a part of FxEuroOpt and should be ignored, however, I > am receiving > expected_element< char > ( > "ExpiryDate", > "") > > exception, which seems to be incorrect, as XML standard states that > unknown elements should be ignored. When XML Schema validation is involved, it is hard to say whether a particular element can be ignored or not without seeing the corresponding schema fragment. There are also ways to disable XML Schema validation but that depends on which mapping you are using (C++/Tree or C++/Parser). If you can let me know which mapping it is, I can give you some pointers on how to turn validation off. Boris --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures. From boris at codesynthesis.com Wed Nov 5 10:03:53 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Parsing issue In-Reply-To: References: <20081105140004.GA26049@karelia> Message-ID: <20081105150353.GB26646@karelia> Hi Ildar, Ildar Farkhshatov writes: > > > > > > > > > > > > > > > > > > > > > > Euro > 1.0 > 1 > NY > 2008-11-29T00:00:00 > 2008-11-12T00:00:00 > 2008-11-14T00:00:00 > > JPY > USD > > USD > USD > Ok, now it all makes sense. The XML fragment you showed earlier is not valid per this schema (there are actually two problems: first, it contains the EffectiveDate and PayCurrency elements that are not allowed by the schema and second, the elements are not in the order that is prescribed by the schema). Unfortunately, there is no way to successfully parse this fragment with the generated code even when the full XML Schema validation is disabled. In the parsing code we have to bail out when we see an unknown element. That's the only reasonably efficient way to parse the base/derived content (the base type should stop parsing on the first unknown element so that the derived type can continue). If you have control over the production of this XML, one way to work around the problem is to move all unknown elements to the end. If you can change the schema (even if only for the purpose of code generation) then you can add the unknown elements as optional: Boris From jan.klimke at hpi.uni-potsdam.de Wed Nov 5 11:57:23 2008 From: jan.klimke at hpi.uni-potsdam.de (Jan Klimke) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Problems linking Code which uses XSD in Release mode In-Reply-To: <20081104100311.GA17545@karelia> References: <490EBD8C.60900@hpi.uni-potsdam.de> <20081103092051.GA14865@karelia> <490EFDC2.4090201@hpi.uni-potsdam.de> <49101472.5070204@hpi.uni-potsdam.de> <20081104100311.GA17545@karelia> Message-ID: <4911D073.1010300@hpi.uni-potsdam.de> Hi Boris, i tried several settings and a bit different code, but nothing of that provoked the faulty linkage. Because a similar problem appereared when i customized my generated classes like described in the complex example. I solved the problem vor now by editing the generated header file containing the xml_schema definitions. No export symbols were generated inside the whole file. Which caused for some reason the linker to exclude those template instanciation from beeing exported. I changed the following files by instanciating the template classes (WFS_API defines dll_export and import depending on compile mode): template class WFS_API ::xsd::cxx::tree::ncname< char, Name >; typedef ::xsd::cxx::tree::ncname< char, Name > Ncname; template class WFS_API ::xsd::cxx::tree::qname< char, SimpleType, Uri, Ncname >; typedef ::xsd::cxx::tree::qname< char, SimpleType, Uri, Ncname > Qname; For other types this does not seem to be a problem at all (like Exception or UnexpectedElement). Thank you for your help, Jan Boris Kolpackov schrieb: > Hi Jan, > > Jan Klimke writes: > > >> I found out that the usage of the Qname Type causes the linker error. >> When i am using a line like this: >> xml_schema::Qname("coll:UriComment") >> Outside the DLL which contains the generated code the mentioned linker >> error occurs. When using these classes inside the library everything >> works fine. >> > > I tried to reproduce this with a test case but had no luck so far. > Could you try it and see if you get any errors? The test case is > here: > > http://www.codesynthesis.com/~boris/tmp/dlltest.zip > > It includes project/solution files for VC++ 8. It also uses the > rules files that are shipped with XSD for compiling the schema > so you may need to add a few paths in the VC++ IDE as described > here: > > http://wiki.codesynthesis.com/Using_XSD_with_Microsoft_Visual_Studio#Visual_Studio_2005_.288.0.29_and_2008_.289.0.29 > > The test is based on the library example. I've added a QName > attribute to the schema (DLL) as well as an instantiation of > xml_schema::qname object in the driver (executable). > > If you don't get any errors either then you can try to figure > out what is different between the test and your project. If > you manage to reproduce the error in the test case, please > let me know. > > Boris > From boris at codesynthesis.com Thu Nov 6 02:47:04 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Problems linking Code which uses XSD in Release mode In-Reply-To: <4911D073.1010300@hpi.uni-potsdam.de> References: <490EBD8C.60900@hpi.uni-potsdam.de> <20081103092051.GA14865@karelia> <490EFDC2.4090201@hpi.uni-potsdam.de> <49101472.5070204@hpi.uni-potsdam.de> <20081104100311.GA17545@karelia> <4911D073.1010300@hpi.uni-potsdam.de> Message-ID: <20081106074704.GA28588@karelia> Hi Jan, Jan Klimke writes: > I solved the problem vor now by editing the generated header file > containing the xml_schema definitions. > > No export symbols were generated inside the whole file. Which caused for > some reason the linker to exclude those template instanciation from > beeing exported. > > I changed the following files by instanciating the template classes > (WFS_API defines dll_export and import depending on compile mode): > > template class WFS_API ::xsd::cxx::tree::ncname< char, Name >; > typedef ::xsd::cxx::tree::ncname< char, Name > Ncname; > > template class WFS_API ::xsd::cxx::tree::qname< char, SimpleType, Uri, > Ncname >; > typedef ::xsd::cxx::tree::qname< char, SimpleType, Uri, Ncname > Qname; Thanks for the feedback. The really mysterious thing about all this is why those two symbols end up having import declaration even though there is no place in the source code where they are declared as such. I think you are using the GML schemas. I am wondering if it will be possible to remove dependencies on other libraries from your project and still get this error. In other words just have a DLL with the generated code and a test driver. If you have time and would like to get to the bottom of this, I am willing to take a look at such a stripped down project. Boris From boris at codesynthesis.com Wed Nov 12 10:23:54 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Problems linking Code which uses XSD in Release mode In-Reply-To: <4912C026.5050408@hpi.uni-potsdam.de> References: <490EBD8C.60900@hpi.uni-potsdam.de> <20081103092051.GA14865@karelia> <490EFDC2.4090201@hpi.uni-potsdam.de> <49101472.5070204@hpi.uni-potsdam.de> <20081104100311.GA17545@karelia> <4911D073.1010300@hpi.uni-potsdam.de> <20081106074704.GA28588@karelia> <4912C026.5050408@hpi.uni-potsdam.de> Message-ID: <20081112152354.GA31647@karelia> Hi Jan, [I've CC'ed xsd-users in case someone else encounters a similar problem.] Jan Klimke writes: > i managed to create a solution which does not run ;-). Thanks for the test case. I did some digging and here is what I uncovered. When you inherit an exported class from a base that is a class template, VC++ automatically instantiates and export this class template. Similarly, when the class is imported, the base template is not instantiated but is rather imported. For example: template struct Foo { void f (); }; struct WFS_API Bar: Foo { }; Here, when WFS_API expands to __declspec(dllexport), Foo::f() is automatically instantiated and also exported. When WFS_API is __declspec(dllimport) and Foo::f() is used, it is not instantiated but instead the symbol from the DLL is used. This normally works fairly well which is the reason we haven't heard of any such problems before. But in your case something happens to VC++ and it doesn't instantiate the two symbols that end up unresolved. I think what happens is that in the DLL the compiler optimizes those functions away (since they are inline) but, for some reason, does not do the same in the executable even though both are compiled with the same options. It seems the only solution is to request explicit instantiation and exporting/importing as you have shown in one of your previous emails: template class WFS_API ::xsd::cxx::tree::ncname< char, Name >; We are thinking of adding an option that would instruct the compiler to generate these requests automatically for all built-in types. Let me know if you would like a pre-release binary with this support. > By the way, do you have an explanation for the compile warnings > concerning the custom-type templates ? Yes, this is actually related to the mechanism described above. Other generated types derive from your custom types and VC++ tries to instantiate and export them. But the definitions for their functions are hidden in the .cpp file where you instantiate the template explicitly. So the warnings are bogus and can be safely ignored. We will suppress them in the next release of XSD. You can also do it by adding the following line: #pragma warning (disable:4661) After #pragma warning (disable:4250) in libxsd/xsd/cxx/compilers/vc-8/pre.hxx. Boris From mirko.kohns at gmail.com Wed Nov 12 17:38:32 2008 From: mirko.kohns at gmail.com (Mirko Kohns) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] http://www.w3.org/2003/05/soap-envelope/ Message-ID: Hi! I am trying to use your software to implement an object marshalling/unmarshalling of xml-soap-messages. I already did this in java by using JAXB. I have various troubles generating the c++ and header files with xsd.exe using this schema: http://www.w3.org/2003/05/soap-envelope/ Do you know if your framework can deal with this schema in mode cxx-tree? Greetings, MIRKO From boris at codesynthesis.com Thu Nov 13 01:28:56 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] http://www.w3.org/2003/05/soap-envelope/ In-Reply-To: References: Message-ID: <20081113062856.GA2082@karelia> Hi Mirko, Mirko Kohns writes: > I have various troubles generating the c++ and header files with > xsd.exe using this schema: > > http://www.w3.org/2003/05/soap-envelope/ In the future it would be helpful to know more details about the problems you experience. > Do you know if your framework can deal with this schema in mode cxx-tree? Yes, it can (we will probably add a SOAP example based on this schema in the next version of XSD). I downloaded the above schema and saved it as soap-envelope.xsd. I also downloaded xml.xsd which it includes from : http://www.w3.org/2001/xml.xsd Then I compiled both schemas with the following options: --namespace-map http://www.w3.org/2003/05/soap-envelope=soap_envelope --namespace-map http://www.w3.org/XML/1998/namespace=xml --location-map http://www.w3.org/2001/xml.xsd=xml.xsd --generate-wildcard --root-element Envelope If you define your message bodies in XML Schema and generate C++ classes from them then you will most likely want to parse the content matched by the wildcards (any & anyAttribute) in the Body type directly into these classes. For more information on how to do this see the 'wildcard' example in the examples/cxx/tree/ directory. Boris From boris at codesynthesis.com Fri Nov 14 12:18:56 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] http://www.w3.org/2003/05/soap-envelope/ In-Reply-To: References: <20081113062856.GA2082@karelia> Message-ID: <20081114171856.GF6400@karelia> Hi Mirko, I've CC'ed xsd-users mailing list to my reply in case someone runs into a similar problem. Mirko Kohns writes: > xml_schema::namespace_infomap map; > map[""].name=""; > map[""].schema="soap-envelope.xsd"; You probably want this to be: map[""].name="http://www.w3.org/2003/05/soap-envelope"; map[""].schema="soap-envelope.xsd"; Or, if you want the output to look more similar to the original: map["soapenv"].name="http://www.w3.org/2003/05/soap-envelope"; map["soapenv"].schema="soap-envelope.xsd"; > My Problem is .. that the programm stops with the line "Parsing file > ..." and never returns. With your "email.xsd" example it works fine. > So I thougt it would be a problem with the soap xsd stuff. > I attached gdb to the stuck application and got this backtrace > > #2 0xb7e3d58e in xercesc_2_7::UnixHTTPURLInputStream::UnixHTTPURLInputStream Here is what happens: the underlying XML parser (Xerces-C++) tries to validate the XML document using the soap-envelope.xsd schema. This schema includes xml.xsd from a remote location. So the parser tries to download it (that's why there is HTTPURL in the stack trace). I tried to run your test case as is and it works fine except for a delay caused by the downloading of the schema. There are several ways how you can address this: 1. Disable XML Schema validation if you don't need it by passing xml_schema::flags::dont_validate to the parsing function. 2. Change soap-envelope.xsd to use local copy of xml.xsd (i.e., change http://www.w3.org/2001/xml.xsd to xml.xsd in the schemaLocation attribute). 3. Pre-load the schemas in the right order yourself. If you load xml.xsd first (from a local copy) and then soap-envelope.xsd then the remote location will be ignored since the file is already loaded. For more information on how to pre-load the schemas see the 'caching' example. Boris From a.omrani at gmail.com Tue Nov 18 08:21:58 2008 From: a.omrani at gmail.com (Azadeh Omrani) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] unhandled exception at memory...tree/parsing problem Message-ID: <183a50e60811180521h7912c053uea23d3f6efea59ba@mail.gmail.com> Hi, I'm new to xsd. I downloaded xsd-3.2.0-i686-windows and I use it by Ms VC9. I've tried both xerces 2.8.0 and 3.0.0. Trying to run an official example in .\xsd-3.2.0-i686-windows\examples\cxx\tree\hello class structure was created successfully. But trying to parse hello.xml by driver.cxx I got the following error: Unhandled exception at 0x7c812aeb in driver.exe : Microsoft C++ exception : xsd::cxx::tree::parsing at memory location 0x0012fb04 Can you please help me? Regards Azom From boris at codesynthesis.com Tue Nov 18 08:52:08 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] unhandled exception at memory...tree/parsing problem In-Reply-To: <183a50e60811180521h7912c053uea23d3f6efea59ba@mail.gmail.com> References: <183a50e60811180521h7912c053uea23d3f6efea59ba@mail.gmail.com> Message-ID: <20081118135208.GA22623@karelia> Hi Azadeh, Azadeh Omrani writes: > Trying to run an official example in > .\xsd-3.2.0-i686-windows\examples\cxx\tree\hello class structure was created > successfully. > But trying to parse hello.xml by driver.cxx I got the following error: > > Unhandled exception at 0x7c812aeb in driver.exe : Microsoft C++ exception : > xsd::cxx::tree::parsing at memory location 0x0012fb04 The hello example that comes with XSD catches and prints xml_schema::exception from which xml_schema::parsing is derived. So you shouldn't get unhandled exception. Can you make sure the parsing code in driver.cxx is inside the try-catch block: try { auto_ptr h (hello (argv[1])); for (hello_t::name_const_iterator i (h->name ().begin ()); i != h->name ().end (); ++i) { cout << h->greeting () << ", " << *i << "!" << endl; } } catch (const xml_schema::exception& e) { cerr << e << endl; return 1; } Boris From gkhokhorin at coade.com Tue Nov 18 09:13:39 2008 From: gkhokhorin at coade.com (Gennady Khokhorin) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] unhandled exception at memory...tree/parsing problem References: <183a50e60811180521h7912c053uea23d3f6efea59ba@mail.gmail.com> <20081118135208.GA22623@karelia> Message-ID: (On request to report new schemas: http://codesynthesis.com/projects/xsd/extras/supported-schemas.xhtml I'm wonder if Team has plan to adopt CIS/2 schema: http://www.steptools.com/support/stdev_docs/express/cis/lpm6.exp Industry: Building modeling standard. So far it exist in lisp or EXPRESS formats Regards, Gennady From boris at codesynthesis.com Tue Nov 18 09:28:33 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] CIS/2 schema Message-ID: <20081118142833.GB22623@karelia> Hi Gennady, Gennady Khokhorin writes: > (On request to report new schemas: > http://codesynthesis.com/projects/xsd/extras/supported-schemas.xhtml > > I'm wonder if Team has plan to adopt CIS/2 schema: > http://www.steptools.com/support/stdev_docs/express/cis/lpm6.exp > > Industry: Building modeling standard. > So far it exist in lisp or EXPRESS formats I am not sure I follow. The above page lists public schemas written in the W3C XML Schema language which were tested and are known to work with CodeSynthesis XSD. The link that you gave points to what seems like a description of something in some other language. At the moment we have no plans supporting other "schema" languages. Boris From rlischner at proteus-technologies.com Tue Nov 18 09:48:28 2008 From: rlischner at proteus-technologies.com (Ray Lischner) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] --generate-forward and --hxx-suffix Message-ID: If I use --generate-forward and --hxx-suffix, the forward declaration file does not use my preferred suffix, but always uses .hxx. Ray Lischner, Senior Member of Technical Staff 133 National Business Pkwy, Ste 150 t. 443.539.3448 Annapolis Junction, MD 20701 c. 410.854.5170 rlischner@proteus-technologies.com f. 443.539.3370 From gkhokhorin at coade.com Tue Nov 18 09:47:02 2008 From: gkhokhorin at coade.com (Gennady Khokhorin) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] RE: CIS/2 schema References: <20081118142833.GB22623@karelia> Message-ID: Sorry, Boris, subject line in my email was confusing. And thanks for info. Mentioned schema (in EXPRESS language) in theory covered all industry standards (architect, civilian, construction, aviation, ...) and I was hoping somebody on the List could suggest LISP/EXPRESS to XSD converter. Happy programming! -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Tuesday, November 18, 2008 8:29 AM To: Gennady Khokhorin Cc: xsd-users@codesynthesis.com Subject: CIS/2 schema Hi Gennady, Gennady Khokhorin writes: > (On request to report new schemas: > http://codesynthesis.com/projects/xsd/extras/supported-schemas.xhtml > > I'm wonder if Team has plan to adopt CIS/2 schema: > http://www.steptools.com/support/stdev_docs/express/cis/lpm6.exp > > Industry: Building modeling standard. > So far it exist in lisp or EXPRESS formats I am not sure I follow. The above page lists public schemas written in the W3C XML Schema language which were tested and are known to work with CodeSynthesis XSD. The link that you gave points to what seems like a description of something in some other language. At the moment we have no plans supporting other "schema" languages. Boris From boris at codesynthesis.com Tue Nov 18 10:05:57 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] --generate-forward and --hxx-suffix In-Reply-To: References: Message-ID: <20081118150557.GE22623@karelia> Hi Ray, Ray Lischner writes: > If I use --generate-forward and --hxx-suffix, the forward declaration > file does not use my preferred suffix, but always uses .hxx. There is the --fwd-suffix option that can be used: --fwd-suffix -fwd.h Note that the value also needs to include the part that will distinguish the forward declaration file from the normal header file. Boris From William.Ma at eisi.com Fri Nov 21 17:06:40 2008 From: William.Ma at eisi.com (Ma, William) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] "'wcstombs' is not a member of 'std'" error when compiling libcult-1.4.2/cult/types/string.hxx Message-ID: I'm trying to build the XSD from source code. I follow the instruction from http://www.codesynthesis.com/projects/xsd/extras/build-windows.xhtml, and it is ok until I'm trying to build libcult-1.4.2: [cid:image001.png@01C94BF1.DD0F51A0] Anyone knows how to solve this problem? Thanks a lot, William Ma ________________________________ The contents of this e-mail and all attachments are confidential and are solely for the use of the addressee. If you are not the intended recipient, be advised that you have received this e-mail in error and that any review, use, dissemination, distribution, printing, copying, or retention of this e-mail and all attachments is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately by return e-mail and permanently delete the e-mail and all attachments from your computer. -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 24643 bytes Desc: image001.png Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20081121/7b171952/image001.png From William.Ma at eisi.com Fri Nov 21 18:57:06 2008 From: William.Ma at eisi.com (Ma, William) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] RE: "'wcstombs' is not a member of 'std'" error when compiling libcult-1.4.2/cult/types/string.hxx Message-ID: Never mind about the problem. I have fixed it after moving the STLport-5.0.1 to the root folder. Thanks, William From: Ma, William Sent: Friday, November 21, 2008 4:07 PM To: 'xsd-users@codesynthesis.com' Subject: "'wcstombs' is not a member of 'std'" error when compiling libcult-1.4.2/cult/types/string.hxx I'm trying to build the XSD from source code. I follow the instruction from http://www.codesynthesis.com/projects/xsd/extras/build-windows.xhtml, and it is ok until I'm trying to build libcult-1.4.2: [cid:image001.png@01C94C02.8F4F6340] Anyone knows how to solve this problem? Thanks a lot, William Ma ________________________________ The contents of this e-mail and all attachments are confidential and are solely for the use of the addressee. If you are not the intended recipient, be advised that you have received this e-mail in error and that any review, use, dissemination, distribution, printing, copying, or retention of this e-mail and all attachments is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately by return e-mail and permanently delete the e-mail and all attachments from your computer. -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 24643 bytes Desc: image001.png Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20081121/4dfecd35/image001.png From jan.klimke at hpi.uni-potsdam.de Tue Nov 25 11:07:45 2008 From: jan.klimke at hpi.uni-potsdam.de (Jan Klimke) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Possibility to resolve all idref inside a document Message-ID: <492C22D1.1040802@hpi.uni-potsdam.de> Hi, i am currently asking myself whether it is possible to resolve all exisitng IdRefs inside a document and replace the elements with the referenced objects (or at least c++ references to them) ? Is there such a tool or is it only possible by traversing the whole document tree ? Jan From boris at codesynthesis.com Wed Nov 26 03:32:34 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Possibility to resolve all idref inside a document In-Reply-To: <492C22D1.1040802@hpi.uni-potsdam.de> References: <492C22D1.1040802@hpi.uni-potsdam.de> Message-ID: <20081126083234.GA21993@karelia> Hi Jan, Jan Klimke writes: > i am currently asking myself whether it is possible to resolve all > exisitng IdRefs inside a document and replace the elements with the > referenced objects (or at least c++ references to them)? The idref instances in the object model act like smart pointers, so you already can get references to the objects they are referred to. By default, the referred to object is returned as xml_schema::type and you will need to cast it to the concrete type. There is also an extension to XML Schema which allows you to specify the type for idref and gives you a statically-typed smart pointer. See the library example on how to do that. There is no automatic way to replace idref instances with the objects they are referring to (I also don't think many people would want to do that) though you can probably achieve this with type customization. Boris From jnw at xs4all.nl Fri Nov 28 04:55:31 2008 From: jnw at xs4all.nl (Jeroen N. Witmond [Bahco]) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Accessing xml:base: Migration to xsd 3.2.0 Message-ID: <23731.80.101.201.227.1227866131.squirrel@webmail.xs4all.nl> Greetings! While testing my work on the xml namespace[1][2] with xsd version 3.2.0 (I should have done this sooner) I've come across a question and a problem. - In file custom-xmlbase/xml-base.cpp[1, item 3][3] I noticed that in constructor 'xml_base::xml_base(::xsd::cxx::tree::type& type, ::xml_schema::flags f)' the call to '::xsd::cxx::xml::dom::parser< wchar_t > p' now takes two additional boolean arguments. I assume based on the code generated by xsd for program explicit[1, top left] that in this case these booleans should be true. Is this correct? - When compiling the sources for programs parser-datamodel[2, bottom left] and parser-anytype[2, bottom right] I get warnings and errors like: virtual base ?xsd::cxx::parser::non_validating::simple_content? inaccessible in ?metadox::bar_type_pimpl? due to ambiguity virtual base 'xsd::cxx::parser::non_validating::complex_content? inaccessible in ?metadox::foo_type_pimpl? due to ambiguity 'xsd::cxx::parser::parser_base' is an ambiguous base of 'metadox::foo_type_pimpl' I've no idea how I can fix this. Regards, Jeroen. [1] http://www.xs4all.nl/~jnw/codesynthesis/xmlnamespace/index.html [2] http://www.xs4all.nl/~jnw/codesynthesis/xmlnamespace/parser.html [3] http://www.xs4all.nl/~jnw/codesynthesis/xmlnamespace/custom-xmlbase/custom-xmlbase.cpp From jnw at xs4all.nl Sat Nov 29 06:02:58 2008 From: jnw at xs4all.nl (Jeroen N. Witmond [Bahco]) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Implement arbitrary-precision custom types for schema builtin types integer and decimal Message-ID: <4804.80.101.201.227.1227956578.squirrel@webmail.xs4all.nl> Greetings! With xsd version 3.2.0, I'm trying to implement arbitrary-precision custom types for the schema builtin types integer and decimal, but I'm running into some problems. The description of these attempts, the problems and a link to the source tarball can be found at http://www.xs4all.nl/~jnw/codesynthesis/arbitrary-precision/ Any help will be appreciated. Jeroen. From steve at finagle.org Sat Nov 29 21:49:50 2008 From: steve at finagle.org (Steve Sloan) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] XML namespace in generated class? Message-ID: <4931FF4E.1060600@finagle.org> Is there any way to access the schema namespace (i.e. 'targetNamespace') from the corresponding generated classes at runtime? I notice that the generated DOM parsing functions check for the appropriate namespace, but use several string constants instead of a const static class member to store it. Moving the namespace to a class-level constant would also allow for a default namespace map when serializing (and parsing). Is there a particular reason why it isn't this way now? Thanks ... -- Steve From a.omrani at gmail.com Sun Nov 30 03:49:00 2008 From: a.omrani at gmail.com (Azadeh Omrani) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Element '...' should be un-qualified?? Message-ID: <183a50e60811300049x7bde59e2ke670f4ab35769f6f@mail.gmail.com> Hi, Thanks for your previous helpful replies Boris, I have a schema file like this: esg.xsd : : : the xml instance file is like this: service.xml Radio Javan 1 cbms://lambdastream.com/mediatitle/109 : : : I used the Namespcae map "urn:dvb:ipdc:esg:2005=esg" Why do you think I get the following runtime error message (in disgnostics_): "Element 'ESG' should be un-qualified" and for all the other elements in the TagretNamespace too... And another question: where can I find the "info" property about each error message? Thank you so much Azadeh From jnw at xs4all.nl Sun Nov 30 09:59:25 2008 From: jnw at xs4all.nl (Jeroen N. Witmond [Bahco]) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Implement arbitrary-precision custom types for schema builtin types integer and decimal Message-ID: <14574.80.101.201.227.1228057165.squirrel@webmail.xs4all.nl> > With xsd version 3.2.0, I'm trying to implement arbitrary-precision custom > types for the schema builtin types integer and decimal, but I'm running > into some problems. The description of these attempts, the problems and a > link to the source tarball can be found at > http://www.xs4all.nl/~jnw/codesynthesis/arbitrary-precision/ Update 30 nov 2008: The work mentioned above was done with xsd cxx-tree. The tarball now also contains directory infinite-parser containing the source code showing how to type-map integer and decimal in xsd cxx-parser. This code is still rather minimal, but functional. Cheers, Jeroen.