From paul.harrison at manchester.ac.uk Fri Nov 1 06:40:18 2013 From: paul.harrison at manchester.ac.uk (Paul Harrison) Date: Fri Nov 1 06:40:22 2013 Subject: [xsd-users] xsd "two phase lookup" problem Message-ID: <313B585F-24F6-44A0-9300-3DDE258EE057@manchester.ac.uk> Hi, having being ?forced? into using clang by an recent upgrade OS X 10.9 I get the error at the end of the message - I believe that this is an instance of clang being stricter about two phase name lookup (http://blog.llvm.org/2009/12/dreaded-two-phase-name-lookup.html) and is fixed as suggested by the compiler?. (though to be honest I have not checked if this breaks other compilers, gcc for instance) Regards, Paul. In file included from /opt/local/include/xsd/cxx/zc-istream.hxx:90: /opt/local/include/xsd/cxx/zc-istream.txx:35:7: error: use of undeclared identifier 'setg' setg (b, b, e); ^ this-> /opt/local/include/xsd/cxx/zc-istream.txx:17:7: note: in instantiation of member function 'xsd::cxx::zc_streambuf::init' requested here init (); ^ /opt/local/include/xsd/cxx/zc-istream.txx:64:11: note: in instantiation of member function 'xsd::cxx::zc_streambuf::zc_streambuf' requested here : buf_ (str) ^ /opt/local/include/xsd/cxx/zc-istream.txx:81:11: note: in instantiation of member function 'xsd::cxx::zc_istream_base::zc_istream_base' requested here : zc_istream_base (str), ^ /opt/local/include/xsd/cxx/tree/parsing/unsigned-int.hxx:69:23: note: in instantiation of member function 'xsd::cxx::zc_istream::zc_istream' requested here zc_istream is (tmp); ^ /opt/local/include/xsd/cxx/tree/parsing/unsigned-int.hxx:44:16: note: in instantiation of member function 'xsd::cxx::tree::traits::create' requested here return create (text_content (e), 0, f, c); ^ /Users/pharriso/Work/jbe/emerlin/log/source/log_schema.C:386:30: note: in instantiation of member function 'xsd::cxx::tree::traits::create' requested here this->code_.set (code_traits::create (i, f, this)); ^ /usr/include/c++/4.2.1/streambuf:504:7: note: must qualify identifier to find this declaration in dependent base class setg(char_type* __gbeg, char_type* __gnext, char_type* __gend) ^ 1 error generated. -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2774 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20131101/d3b5bf55/smime.bin From boris at codesynthesis.com Sun Nov 3 01:19:07 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Nov 3 01:21:30 2013 Subject: [xsd-users] xsd "two phase lookup" problem In-Reply-To: <313B585F-24F6-44A0-9300-3DDE258EE057@manchester.ac.uk> References: <313B585F-24F6-44A0-9300-3DDE258EE057@manchester.ac.uk> Message-ID: Hi Paul, Paul Harrison writes: > I get the error at the end of the message - I believe that this is an > instance of clang being stricter about two phase name lookup [...] This is a know issue that we have fixed for the next release (coming soon). In the meantime, you can apply this patch to the XSD distribution and everything will compile fine: http://www.codesynthesis.com/~boris/tmp/xsd/xsd-3.3.0-gcc-4.7-clang.patch Boris From Juan.Puertos at g-cluster.com Wed Nov 6 08:19:27 2013 From: Juan.Puertos at g-cluster.com (Juan Puertos) Date: Wed Nov 6 08:19:36 2013 Subject: [xsd-users] cross-compile fails to find Message-ID: Hi, I am trying to cross-compile on app from Fedora 19 to mingw32. My application uses some .cxx/.hxx generated by xsd, I get the following error: whatever.cxx: fatal error: xsd/cxx/pre.hxx: No such file or directory #include Facts: 1. I call " mingw32-configure --with-xsdcxx-inc". 2. In Fedora 19 I have installed " xsd.x86_64", the headers are certainly located at "/usr/include/xsd" 3. Makefile.am has: app_CPPFLAGS = $(GTKMM_CFLAGS) $(XERCES_CFLAGS) $(XSDCXX_CPPFLAGS) -std=c++11 -fpermissive Could it just be that my autoconf is old and does not have support for --with-xsdcxx-inc? What would be the workaround then? Thanks, Juan V. Puertos ________________________________ Confidentiality Notice This e-mail (including any attachments) may contain information that is confidential or privileged. If you are not the intended recipient, please notify the sender immediately by reply e-mail and then delete this message. Unauthorized copying, disclosure, distribution or other use of this information, or taking any action in reliance upon this information is prohibited. From Juan.Puertos at g-cluster.com Wed Nov 6 09:05:46 2013 From: Juan.Puertos at g-cluster.com (Juan Puertos) Date: Wed Nov 6 09:05:56 2013 Subject: [xsd-users] FW: cross-compile fails to find Message-ID: Hi, The solution is to create a link form /usr/i686-mingw32[...]/xsd to /usr/include/xsd Thanks, Jaun. From: Juan Puertos Sent: Wednesday, November 06, 2013 15:19 To: 'xsd-users@codesynthesis.com' Subject: cross-compile fails to find Hi, I am trying to cross-compile on app from Fedora 19 to mingw32. My application uses some .cxx/.hxx generated by xsd, I get the following error: whatever.cxx: fatal error: xsd/cxx/pre.hxx: No such file or directory #include Facts: 1. I call " mingw32-configure --with-xsdcxx-inc". 2. In Fedora 19 I have installed " xsd.x86_64", the headers are certainly located at "/usr/include/xsd" 3. Makefile.am has: app_CPPFLAGS = $(GTKMM_CFLAGS) $(XERCES_CFLAGS) $(XSDCXX_CPPFLAGS) -std=c++11 -fpermissive Could it just be that my autoconf is old and does not have support for --with-xsdcxx-inc? What would be the workaround then? Thanks, Juan V. Puertos ________________________________ Confidentiality Notice This e-mail (including any attachments) may contain information that is confidential or privileged. If you are not the intended recipient, please notify the sender immediately by reply e-mail and then delete this message. Unauthorized copying, disclosure, distribution or other use of this information, or taking any action in reliance upon this information is prohibited. From huan0500 at umn.edu Thu Nov 7 10:49:55 2013 From: huan0500 at umn.edu (JinhuaColin Huang) Date: Thu Nov 7 14:11:31 2013 Subject: [xsd-users] Get access to XML data in C++ Message-ID: Hi all, I have got my SwapDeal C++ class generated. But how can i next get access to the data in SwapDeal, like the TradeDate, YieldCurve etc. CodeSynthesis gives us an example: auto_ptr c = contact ("c.xml"); cout << c->name () << ", " << c->email () << ", " << c->phone () << endl; But i cannot find any constructor in my C++ class that takes in an xml file as input parameter. Thanks! Colin Huang Master of Financial Mathematics University of Minnesota-Twin Cities Phone: 612-300-1585 Email: huan0500@umn.edu LinkedIn: http://www.linkedin.com/pub/jinhua-colin-huang/2b/a4b/460 Blog: http://jinhuahuang.blogspot.com/ From eaguilerai at hotmail.com Thu Nov 7 14:27:12 2013 From: eaguilerai at hotmail.com (Erasmo Aguilera) Date: Thu Nov 7 23:14:41 2013 Subject: [xsd-users] Problem with naming convention compiler options on Windows Message-ID: Hello, I installed the xsd-3.3.msi package on Windows 8 Pro x64. When using the xsd compiler with naming convention options such as --type-naming, --function-naming or --*-regex, the following error appears: "error: unknown option 'option' info: try 'xsd help' for usage information" where 'option' is the typed naming convention option, e. g. --type-naming, etc. From boris at codesynthesis.com Fri Nov 8 02:11:37 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Nov 8 02:14:00 2013 Subject: [xsd-users] Get access to XML data in C++ In-Reply-To: References: Message-ID: Hi, JinhuaColin Huang writes: > I have got my SwapDeal C++ class generated. But how can i next get access > to the data in SwapDeal, like the TradeDate, YieldCurve etc. By reading the documentation: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/ At least read through the "Hello World" example. Boris From boris at codesynthesis.com Fri Nov 8 02:14:16 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Nov 8 02:16:39 2013 Subject: [xsd-users] Problem with naming convention compiler options on Windows In-Reply-To: References: Message-ID: Hi Erasmo, Erasmo Aguilera writes: > When using the xsd compiler with naming convention options such as > --type-naming, --function-naming or --*-regex, the following error appears: You are probably trying to use cxx-parser. The naming options are only supported in cxx-tree. If that's not the problem, then show the exact XSD command line you are using and the exact error you are getting. Boris From eaguilerai at hotmail.com Fri Nov 8 12:10:08 2013 From: eaguilerai at hotmail.com (Erasmo Aguilera) Date: Fri Nov 8 12:10:18 2013 Subject: [xsd-users] Problem with naming convention compiler options on Windows In-Reply-To: References: Message-ID: Hi, Thanks for the information. Indeed, I was using the cxx-parser. I think I didn't realize of the problem because I was interested in using the cxx-parser only, and didn't read the cxx-tree command options. After that, I jumped right into the NAMING CONVENTION section of the Command Line Manual, but in there it doesn't mention (or at least I can't find somewhere) that naming conventions are supported by the cxx-tree only. So if I'm not wrong, I would recommend to include a note within the NAMING CONVENTION section. Thanks again. Erasmo. -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: viernes, 08 de noviembre de 2013 01:14 a.m. To: Erasmo Aguilera Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] Problem with naming convention compiler options on Windows Hi Erasmo, Erasmo Aguilera writes: > When using the xsd compiler with naming convention options such as > --type-naming, --function-naming or --*-regex, the following error appears: You are probably trying to use cxx-parser. The naming options are only supported in cxx-tree. If that's not the problem, then show the exact XSD command line you are using and the exact error you are getting. Boris From c0nfuser at hotmail.com Mon Nov 11 12:39:48 2013 From: c0nfuser at hotmail.com (confy con) Date: Mon Nov 11 12:39:56 2013 Subject: [xsd-users] hide .xsd file from the schemaLocation attribute Message-ID: Hello, I would like to ask If there is any option of validating my xml without specifying the .xsd location in the "xsi:schemaLocation=" attribute. e.g my xml file. TEST I want to hide/embeed the .xsd location for security reasons, so is there any other option to do that? (remove the xsi:schemaLocation="http://test/" {relative/absolute path}/Test.xsd) Cheers, George From boris at codesynthesis.com Mon Nov 11 13:01:36 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Nov 11 13:04:00 2013 Subject: [xsd-users] hide .xsd file from the schemaLocation attribute In-Reply-To: References: Message-ID: Hi, confy con writes: > I would like to ask If there is any option of validating my xml > without specifying the .xsd location in the "xsi:schemaLocation=" > attribute. Yes, see Section 5.1, "XML Schema Validation and Searching" in the C++/Tree Mapping Getting Started Guide: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#5.1 Boris From eaguilerai at hotmail.com Tue Nov 12 13:18:05 2013 From: eaguilerai at hotmail.com (Erasmo Aguilera) Date: Tue Nov 12 13:18:30 2013 Subject: [xsd-users] Using XSD with MinGW-w64. Message-ID: Hello, I want to use XSD with MinGW-w64 instead of Visual Studio, but the binaries provided in xsd-3.3.msi are for Visual Studio only. How can I solve it? From boris at codesynthesis.com Tue Nov 12 13:38:13 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Nov 12 13:43:58 2013 Subject: [xsd-users] Using XSD with MinGW-w64. In-Reply-To: References: Message-ID: Hi Erasmo, Erasmo Aguilera writes: > I want to use XSD with MinGW-w64 instead of Visual Studio, but the binaries > provided in xsd-3.3.msi are for Visual Studio only. How can I solve it? You can use xsd-3.3.0-i686-windows.zip. The XSD runtime (libxsd) is header-only. So you will only need to build Xerces-C++ for MinGW. See instructions on the Xerces-C++ website for how to do this. Boris From eaguilari at unitec.edu Tue Nov 12 21:12:57 2013 From: eaguilari at unitec.edu (Erasmo Aguilera) Date: Tue Nov 12 22:21:02 2013 Subject: [xsd-users] Error on building XSD using Cygwin. Message-ID: Hello, I'm trying to build XSD with Cygwin, on Windows 8 Pro 64-bit. Following the building instructions (at http://www.codesynthesis.com/projects/xsd/extras/build-windows.xhtml), when configuring STLPort by running: ./configure --no-cygwin I get the following message: --no-cygwin: Don't forget to uncomment _STLP_NO_CYGWIN macro in stlport/stl/_site_config.h to use such a configuration. The macro is already uncommented (although guarded, but uncommented). By trying to build STLport anyway, the following error appears: c++: error: unrecognized command line option '-mno-cygwin' make: *** [obj/gcc/shared/dll_main.o] Error 1 So I tried configuring with --mno-cygwin instead of the -no-cygwin option. After that, when running make -f gcc.mak install-release-static, I get the following errors: ../../src/num_put_float.cpp: In function 'bool stlp_std::_Stl_is_neg_nan(double)': ../../src/num_put_float.cpp:227:58: error: 'isnan' was not declared in this scope inline bool _Stl_is_neg_nan(double x) { return isnan(x) && ( copysign(1., x) < 0 ); } ^ ../../src/num_put_float.cpp: In function 'bool stlp_std::_Stl_is_inf(double)': ../../src/num_put_float.cpp:228:58: error: 'isinf' was not declared in this scope inline bool _Stl_is_inf(double x) { return isinf(x); } ^ ../../src/num_put_float.cpp: In function 'bool stlp_std::_Stl_is_neg_inf(double)': ../../src/num_put_float.cpp:230:58: error: 'isinf' was not declared in this scope inline bool _Stl_is_neg_inf(double x) { return isinf(x) && x < 0; } ^ Other warnings and notes appear too, so I attached the errors file. I don't know if the --no-cygwin option is misspelled, but in either case I have troubles. Thanks for your help. Erasmo. -------------- next part -------------- In file included from ../../stlport/stl/_num_put.h:198:0, from ../../src/num_put.h:23, from ../../src/num_put_float.cpp:97: ../../stlport/stl/_num_put.c: In function ‘_OutputIter stlp_std::__copy_integer_and_fill(const _CharT*, std::ptrdiff_t, _OutputIter, stlp_std::ios_base::fmtflags, stlp_std::streamsize, _CharT, _CharT, _CharT)’: ../../stlport/stl/_num_put.c:166:75: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] typedef char __static_assert[(sizeof(streamsize) > sizeof(ptrdiff_t)) || ^ ../../stlport/stl/_num_put.c:166:18: warning: typedef ‘__static_assert’ locally defined but not used [-Wunused-local-typedefs] typedef char __static_assert[(sizeof(streamsize) > sizeof(ptrdiff_t)) || ^ ../../src/num_put_float.cpp: In function ‘bool stlp_std::_Stl_is_neg_nan(double)’: ../../src/num_put_float.cpp:227:58: error: ‘isnan’ was not declared in this scope inline bool _Stl_is_neg_nan(double x) { return isnan(x) && ( copysign(1., x) < 0 ); } ^ ../../src/num_put_float.cpp:227:58: note: suggested alternative: In file included from ../../stlport/cmath:30:0, from ../../src/num_put_float.cpp:83: /usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/cmath:836:5: note: ‘std::isnan’ isnan(_Tp __f) ^ ../../src/num_put_float.cpp: In function ‘bool stlp_std::_Stl_is_inf(double)’: ../../src/num_put_float.cpp:228:58: error: ‘isinf’ was not declared in this scope inline bool _Stl_is_inf(double x) { return isinf(x); } ^ ../../src/num_put_float.cpp:228:58: note: suggested alternative: In file included from ../../stlport/cmath:30:0, from ../../src/num_put_float.cpp:83: /usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/cmath:827:5: note: ‘std::isinf’ isinf(_Tp __f) ^ ../../src/num_put_float.cpp: In function ‘bool stlp_std::_Stl_is_neg_inf(double)’: ../../src/num_put_float.cpp:230:58: error: ‘isinf’ was not declared in this scope inline bool _Stl_is_neg_inf(double x) { return isinf(x) && x < 0; } ^ ../../src/num_put_float.cpp:230:58: note: suggested alternative: In file included from ../../stlport/cmath:30:0, from ../../src/num_put_float.cpp:83: /usr/lib/gcc/x86_64-pc-cygwin/4.8.2/include/c++/cmath:827:5: note: ‘std::isinf’ isinf(_Tp __f) ^ ../../src/num_put_float.cpp: In function ‘bool stlp_std::_Stl_is_inf(double)’: ../../src/num_put_float.cpp:228:61: warning: control reaches end of non-void function [-Wreturn-type] inline bool _Stl_is_inf(double x) { return isinf(x); } ^ ../../src/num_put_float.cpp: In function ‘bool stlp_std::_Stl_is_neg_inf(double)’: ../../src/num_put_float.cpp:230:70: warning: control reaches end of non-void function [-Wreturn-type] inline bool _Stl_is_neg_inf(double x) { return isinf(x) && x < 0; } ^ ../../src/num_put_float.cpp: In function ‘bool stlp_std::_Stl_is_neg_nan(double)’: ../../src/num_put_float.cpp:227:88: warning: control reaches end of non-void function [-Wreturn-type] inline bool _Stl_is_neg_nan(double x) { return isnan(x) && ( copysign(1., x) < 0 ); } ^ make: *** [obj/gcc/shared/num_put_float.o] Error 1 From boris at codesynthesis.com Wed Nov 13 00:58:54 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Nov 13 01:01:19 2013 Subject: [xsd-users] Error on building XSD using Cygwin. In-Reply-To: References: Message-ID: Hi Erasmo, Erasmo Aguilera writes: > I'm trying to build XSD with Cygwin, on Windows 8 Pro 64-bit. Unless you have a good reason for wanting to build the XSD compiler yourself (i.e., you want to modify it), I suggest that you use the pre-built binary instead. > Following the building instructions (at > http://www.codesynthesis.com/projects/xsd/extras/build-windows.xhtml), when > configuring STLPort by running: Recent versions of GCC for MinGW-W64 finally have proper support for wchar_t. This means that you no longer need to build STLPort and instead should be able to use GCC's stock libstdc++. Boris From eaguilerai at hotmail.com Fri Nov 15 15:30:23 2013 From: eaguilerai at hotmail.com (Erasmo Aguilera) Date: Fri Nov 15 15:30:32 2013 Subject: [xsd-users] Can't parse root element with xmlns attribute. Message-ID: Hi, I barely modified the hello example from the C++/Parser Mapping Getting Started Guide is such a way that it uses namespaces. The XML Schema (hello.xsd): ... The XML instance document (hello.xml): ... The XSD compilation command: xsd cxx-parser^ --xml-parser xerces^ --output-dir parser\^ --force-overwrite^ --hxx-suffix .h^ --cxx-suffix .cpp^ --generate-print-impl^ --generate-test-driver^ --generate-validation^ --skel-type-suffix "-pskel"^ --skel-file-suffix "-pskel"^ --impl-type-suffix "-pimpl"^ --impl-file-suffix "-pimpl"^ hello.xsd The output files compile correctly on Visual Studio 2012. The problem comes at the execution when using hello.xml: .../hello.xml:4:67 error: unexpected attribute 'xmlns' I supposed that was because the xmlns attribute wasn't defined for the hello element in the XML Schema, but as you know, you can't define an attribute with such a name. Thanks for your help. Erasmo. From c0nfuser at hotmail.com Fri Nov 15 15:42:57 2013 From: c0nfuser at hotmail.com (confy con) Date: Fri Nov 15 15:43:05 2013 Subject: [xsd-users] hide .xsd file from the schemaLocation attribute In-Reply-To: References: , Message-ID: Hello Boris, Thank you for your fast reply, I read the documentation and suits me the third option with the embeeded xsd because I would prefer to not distribute the .xsd schema with the parser.After I checked your the embedded example but as far as I understand there is not any straight forward way to do that.. What I mean is: 1) First you create an executable which converts the .xsd file into 2 binary(like) XMLByte type library.2) Then you create a parser which reads this schema from memory and then can validate the xml files whithout need to locate the .xsd. My questions are: 1) Is there any Official Codesynthesis Tool which does the first convertion?(like xsdbin) I tried to check the xsd command line but I couldnt find any similar option..2) Is there any "wrapper" like function which does the job directly? Like to loadmemory,deserialize,and parse directly the library without have to create my own grammar_input_stream lib etc.. I am not lazy to create my own or even copy your example, I just need a more "tested" or "official" way to implement that in order to avoid future "surprices" :) Regards, G. > Date: Mon, 11 Nov 2013 20:01:36 +0200 > From: boris@codesynthesis.com > To: c0nfuser@hotmail.com > CC: xsd-users@codesynthesis.com > Subject: Re: [xsd-users] hide .xsd file from the schemaLocation attribute > > Hi, > > confy con writes: > > > I would like to ask If there is any option of validating my xml > > without specifying the .xsd location in the "xsi:schemaLocation=" > > attribute. > > Yes, see Section 5.1, "XML Schema Validation and Searching" in the > C++/Tree Mapping Getting Started Guide: > > http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#5.1 > > Boris From boris at codesynthesis.com Sat Nov 16 07:22:58 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sat Nov 16 07:25:21 2013 Subject: [xsd-users] hide .xsd file from the schemaLocation attribute In-Reply-To: References: Message-ID: Hi, confy con writes: > 1) Is there any Official Codesynthesis Tool which does the first > convertion? No, the binary representation of the schema is Xerces-C++ version- dependent so you must build xsdbin with the same Xerces-C++ build that you are using to build your application. > 2) Is there any "wrapper" like function which does the job directly? No, there isn't it. > I am not lazy to create my own or even copy your example, I just need > a more "tested" or "official" way to implement that in order to avoid > future "surprices" :) xsdbin and the code in the example is the "tested" and "official" way. Boris From boris at codesynthesis.com Sat Nov 16 07:37:57 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sat Nov 16 07:40:20 2013 Subject: [xsd-users] Can't parse root element with xmlns attribute. In-Reply-To: References: Message-ID: Hi Erasmo, Erasmo Aguilera writes: > I supposed that was because the xmlns attribute wasn't defined for the hello > element in the XML Schema, but as you know, you can't define an attribute > with such a name. No, xmlns is a built-in attribute and it cannot be "defined". I just took the hello example, made the modifications you described, and everything works fine. Note that you need to change your doc_p constructor to include the namespace: xml_schema::document doc_p (hello_p, "http://www.mysite.com/hello", "hello"); Boris From eaguilerai at hotmail.com Sat Nov 16 14:24:55 2013 From: eaguilerai at hotmail.com (Erasmo Aguilera) Date: Sat Nov 16 14:25:05 2013 Subject: [xsd-users] Can't parse root element with xmlns attribute. In-Reply-To: References: Message-ID: Hi Boris, As you might notice, I used the --generate-test-driver flag in the XSD compiler. In my case, the output driver already constructs the doc_p with the namespace of the root element. If you have compiled the code with Visual Studio, I'll be grateful that you send me the individual files you used or place a copy of the entire project on my SkyDrive: https://skydrive.live.com/redir?resid=A8C8268C5A1D5215!476&authkey=!AL7b7XH0 HkufYj8 Thanks again. Erasmo. -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: s?bado, 16 de noviembre de 2013 06:38 a.m. To: Erasmo Aguilera Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] Can't parse root element with xmlns attribute. Hi Erasmo, Erasmo Aguilera writes: > I supposed that was because the xmlns attribute wasn't defined for the > hello element in the XML Schema, but as you know, you can't define an > attribute with such a name. No, xmlns is a built-in attribute and it cannot be "defined". I just took the hello example, made the modifications you described, and everything works fine. Note that you need to change your doc_p constructor to include the namespace: xml_schema::document doc_p (hello_p, "http://www.mysite.com/hello", "hello"); Boris From boris at codesynthesis.com Mon Nov 18 09:40:41 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Nov 18 09:43:06 2013 Subject: [xsd-users] Can't parse root element with xmlns attribute. In-Reply-To: References: Message-ID: Hi Erasmo, Erasmo Aguilera writes: > If you have compiled the code with Visual Studio, I'll be grateful that you > send me the individual files [...] See attached. Replace the files in the hello example with the ones in the archive and built with the provided solution. Boris -------------- next part -------------- A non-text attachment was scrubbed... Name: test.zip Type: application/zip Size: 1815 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20131118/384c9ec8/test.zip From begeta at gmail.com Mon Nov 18 10:44:47 2013 From: begeta at gmail.com (Pablo Cobreros) Date: Mon Nov 18 12:34:57 2013 Subject: [xsd-users] Help with c++ parser from xsd:users. Writting in the xml file Message-ID: Greetings! I?m working with c++ parser. I have to read an xml file, change some values and after that write in the xml with the new values. I have read the entire C++/Parser Mapping Getting Started Guide and I have no problems reading from my xml file. However, I can not undestand how to write in the xml file. I have been looking, trying to understand how to create the code for writting. Could you please send me an example explaining how to write in a xml file. If there is already an example in the started guide I would appreciate an explanation about how to do it and its localization. Thank you very much. I really appreciate your help. Pablo. (Spain) From eaguilerai at hotmail.com Mon Nov 18 13:29:51 2013 From: eaguilerai at hotmail.com (Erasmo Aguilera) Date: Mon Nov 18 13:30:01 2013 Subject: [xsd-users] Can't parse root element with xmlns attribute. In-Reply-To: References: Message-ID: Hi Boris: The source of my problem was the --generate-validation option. I remove it from the XSD compilation and everything worked perfectly. Could you please explain me why does it happen? -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: lunes, 18 de noviembre de 2013 08:41 a.m. To: Erasmo Aguilera Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] Can't parse root element with xmlns attribute. Hi Erasmo, Erasmo Aguilera writes: > If you have compiled the code with Visual Studio, I'll be grateful > that you send me the individual files [...] See attached. Replace the files in the hello example with the ones in the archive and built with the provided solution. Boris From begeta at gmail.com Tue Nov 19 03:35:16 2013 From: begeta at gmail.com (Pablo Cobreros) Date: Tue Nov 19 03:35:22 2013 Subject: [xsd-users] Help with c++ parser from xsd:users. Writting in the xml file Message-ID: Greetings! I?m working with c++ parser. I have to read an xml file, change some values and after that write in the xml with the new values. I have read the entire C++/Parser Mapping Getting Started Guide and I have no problems reading from my xml file. However, I can not undestand how to write in the xml file. I have been looking, trying to understand how to create the code for writting. Could you please send me an example explaining how to write in a xml file. If there is already an example in the started guide I would appreciate an explanation about how to do it and its localization. Thank you very much. I really appreciate your help. Pablo. (Spain) From boris at codesynthesis.com Tue Nov 19 08:02:40 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Nov 19 08:05:06 2013 Subject: [xsd-users] Help with c++ parser from xsd:users. Writting in the xml file In-Reply-To: References: Message-ID: Hi Pablo, Please don't send multiple copies of the same email. One is enough. Pablo Cobreros writes: > However, I can not undestand how to write in the xml file. I have been > looking, trying to understand how to create the code for writting. C++/Parser, as the name suggests, only supports XML parsing. If you also need XML serialization, then you may want to consider using C++/Tree instead. Another option is to use XSD/e instead of XSD, which, besides the C++/Parser mapping, also provides C++/Serializer. Boris From boris at codesynthesis.com Tue Nov 19 08:06:05 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Nov 19 08:08:29 2013 Subject: [xsd-users] Can't parse root element with xmlns attribute. In-Reply-To: References: Message-ID: Hi Erasmo, Erasmo Aguilera writes: > The source of my problem was the --generate-validation option. I remove it > from the XSD compilation and everything worked perfectly. > > Could you please explain me why does it happen? I am not sure. I tried to add this option to my test and everything still works fine. Normally, though, you wouldn't use --generate-validation with Xerces-C++ since it supports schema validation at the parser level. Boris From eaguilerai at hotmail.com Tue Nov 19 13:59:30 2013 From: eaguilerai at hotmail.com (Erasmo Aguilera) Date: Tue Nov 19 13:59:42 2013 Subject: [xsd-users] Can't parse root element with xmlns attribute. In-Reply-To: References: Message-ID: Hi Boris, You're right, I wouldn't use it. I included it because I was making tests with both Xerces and Expat. That way I avoided the nuisance of putting and quitting the option. It must be a subtlety. If you didn't before, maybe you should try to make a test with the exact same components I gave you at the beginning (i.e., files and XSD command). If you already did it, then only God will know what happened. Thanks a lot. Erasmo. -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: martes, 19 de noviembre de 2013 07:06 a.m. To: Erasmo Aguilera Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] Can't parse root element with xmlns attribute. Hi Erasmo, Erasmo Aguilera writes: > The source of my problem was the --generate-validation option. I > remove it from the XSD compilation and everything worked perfectly. > > Could you please explain me why does it happen? I am not sure. I tried to add this option to my test and everything still works fine. Normally, though, you wouldn't use --generate-validation with Xerces-C++ since it supports schema validation at the parser level. Boris From liyubo at dayang.com.cn Wed Nov 20 06:53:21 2013 From: liyubo at dayang.com.cn (liyubo) Date: Wed Nov 20 07:39:12 2013 Subject: [xsd-users] polymorphism problem when serialization to xml Message-ID: <528CA2B0.4080006@dayang.com.cn> Hi, I have a problem when try to construct a xml using XSD. I try to modify the sample project "CodeSynthesis XSD 3.3\examples\cxx\tree\polymorphism" to do this. here is my code int main (int argc, char* argv[]) { ::supermen all; ::supermen::person_sequence seqPerson; person p("Normal"); superman s("Super",true); seqPerson.push_back(p); seqPerson.push_back(s); all.person(seqPerson); xml_schema::namespace_infomap map; map[""].schema = "supermen.xsd"; supermen_(std::cout, all, map); } The output in console is Normal Super Why the second element is still "person" but not "superman" ? How to fix this to make the "person_sequence" polymorphism? 2013-11-20 liyubo From boris at codesynthesis.com Thu Nov 21 03:06:47 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Nov 21 03:09:12 2013 Subject: [xsd-users] polymorphism problem when serialization to xml In-Reply-To: <528CA2B0.4080006@dayang.com.cn> References: <528CA2B0.4080006@dayang.com.cn> Message-ID: Hi, liyubo writes: > I try to modify the sample project "examples\cxx\tree\polymorphism" > to do this. > > int > main (int argc, char* argv[]) > { > ::supermen all; > > ::supermen::person_sequence seqPerson; > > person p("Normal"); > superman s("Super",true); > > seqPerson.push_back(p); > seqPerson.push_back(s); > > all.person(seqPerson); > > xml_schema::namespace_infomap map; > map[""].schema = "supermen.xsd"; > > supermen_(std::cout, all, map); > } I took the original 'polymorphism' example, replaced main() in driver.cxx with your code above, and it works correctly. Here is what I get: Normal Super So you must have also modified something else that broke things. Boris From liyubo at dayang.com.cn Thu Nov 21 03:32:25 2013 From: liyubo at dayang.com.cn (liyubo) Date: Thu Nov 21 03:40:19 2013 Subject: [xsd-users] polymorphism problem when serialization to xml In-Reply-To: References: <528CA2B0.4080006@dayang.com.cn> Message-ID: <528DC517.1010502@dayang.com.cn> Oh dear Boris, Thank you sincerely. It's my mistake. I forget the "--generate-polymorphic" option to generate the code. Now everything works correctly! Thank god thank you! 2013-11-21 liyubo ????Boris Kolpackov ?????2013-11-21 16:06 ???Re: [xsd-users] polymorphism problem when serialization to xml ????"liyubo" ???"xsd-users" Hi, liyubo writes: > I try to modify the sample project "examples\cxx\tree\polymorphism" > to do this. > > int > main (int argc, char* argv[]) > { > ::supermen all; > > ::supermen::person_sequence seqPerson; > > person p("Normal"); > superman s("Super",true); > > seqPerson.push_back(p); > seqPerson.push_back(s); > > all.person(seqPerson); > > xml_schema::namespace_infomap map; > map[""].schema = "supermen.xsd"; > > supermen_(std::cout, all, map); > } I took the original 'polymorphism' example, replaced main() in driver.cxx with your code above, and it works correctly. Here is what I get: Normal Super So you must have also modified something else that broke things. Boris From liyubo at dayang.com.cn Thu Nov 21 05:36:20 2013 From: liyubo at dayang.com.cn (liyubo) Date: Thu Nov 21 11:45:37 2013 Subject: [xsd-users] Help, about [2.12.3 Mapping for any with the Sequence Cardinality Class] Message-ID: <528DE223.2040509@dayang.com.cn> Hi,Boris Kolpackov, I have a problem about the manual at [2.12.3 Mapping for any with the Sequence Cardinality Class]. Here my XSD is And here is the generate cmd xsd cxx-tree --generate-serialization --generate-polymorphic any.xsd But the code generated is class object: public ::xml_schema::type { public: // Constructors. // object (); object (const ::xercesc::DOMElement& e, ::xml_schema::flags f = 0, ::xml_schema::container* c = 0); object (const object& x, ::xml_schema::flags f = 0, ::xml_schema::container* c = 0); virtual object* _clone (::xml_schema::flags f = 0, ::xml_schema::container* c = 0) const; virtual ~object (); // Implementation. // protected: void parse (::xsd::cxx::xml::dom::parser< char >&, ::xml_schema::flags); protected: }; There is no element_sequence like [2.12.3 Mapping for any with the Sequence Cardinality Class]. Is there anything wrong? How can I solve this? Please help me, Thank you! 2013-11-21 liyubo From Farhat.Latrach at sc.com Thu Nov 21 10:14:59 2013 From: Farhat.Latrach at sc.com (Latrach, Farhat) Date: Thu Nov 21 11:45:38 2013 Subject: [xsd-users] cxx-parser with --file-per-type Message-ID: <7F6839155D74054CB0971462A215DAC915D31E6E@HKWPIPXMB01C> Hi Boris, First of all, thanks for your great xsd compiler. I have a very complicated schemas with many include/import. I tried to use the cxx-parser with option -file-per-type to ensure of a complete parser but xsd always ends with runtime error at mid road! Is there any option like -parts of cxx-tree to use with cxx-parser? Thanks. This email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please delete all copies and notify the sender immediately. You may wish to refer to the incorporation details of Standard Chartered PLC, Standard Chartered Bank and their subsidiaries at http://www.standardchartered.com/en/incorporation-details.html. From boris at codesynthesis.com Thu Nov 21 11:50:46 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Nov 21 11:53:10 2013 Subject: [xsd-users] Help, about [2.12.3 Mapping for any with the Sequence Cardinality Class] In-Reply-To: <528DE223.2040509@dayang.com.cn> References: <528DE223.2040509@dayang.com.cn> Message-ID: Hi, liyubo writes: > There is no element_sequence like [2.12.3 Mapping for any with the > Sequence Cardinality Class]. Is there anything wrong? Yes, you didn't read the documentation. The first sentence in Section 2.12 clearly states: "For the XML Schema any and anyAttribute wildcards an optional mapping can be requested with the --generate-wildcard option." Boris From boris at codesynthesis.com Thu Nov 21 11:55:26 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Nov 21 11:57:54 2013 Subject: [xsd-users] cxx-parser with --file-per-type In-Reply-To: <7F6839155D74054CB0971462A215DAC915D31E6E@HKWPIPXMB01C> References: <7F6839155D74054CB0971462A215DAC915D31E6E@HKWPIPXMB01C> Message-ID: Hi Farhat, Latrach, Farhat writes: > First of all, thanks for your great xsd compiler. Thanks, I am glad you like it. > I have a very complicated schemas with many include/import. I tried to > use the cxx-parser with option -file-per-type to ensure of a complete > parser but xsd always ends with runtime error at mid road! I can't say for sure what it wrong without knowing exactly what error you are getting. Having said that, the C++/Parser mapping is meant for simple schemas since you will have to implement a parser for every type yourself. For complex schemas I would recommend you use C++/Tree instead. > Is there any option like -parts of cxx-tree to use with cxx-parser? No. Also, this option won't help you with your issue (complex import/include graphs). Boris From Farhat.Latrach at sc.com Thu Nov 21 14:53:27 2013 From: Farhat.Latrach at sc.com (Latrach, Farhat) Date: Thu Nov 21 23:33:52 2013 Subject: [xsd-users] cxx-parser with --file-per-type In-Reply-To: References: <7F6839155D74054CB0971462A215DAC915D31E6E@HKWPIPXMB01C> Message-ID: <7F6839155D74054CB0971462A215DAC915D31FCD@HKWPIPXMB01C> Hi Boris, Thanks for your prompt answers. For my case, the cxx-tree does not fit well my need as I still need to parse the whole tree and for such amount of objects it will be very complicated. I would prefer parse directly with xercess instead. Please let me know if I am wrong. The pattern of the error is when I run xsd cxx-parser -file-per-type --generate-validation the xsd starts generating some files and suddenly ends with "runtime error". I removed the --generate-validation (I have changed to use xercess instead of expat) the error disappeared and a big chunk of files are generated. It works fine. I guess there is something wrong when using both --file-per-type and --generate-validation. The test driver file I got does contain only the root element in the my_schema.xsd I am compiling. But, The xml I am expecting to parse has the root element of the included schema:( So, I did generate a test driver for the included schema as well and I have tried modifying one of its generated parsers by adding to it my_schema_test_drive root parser (a way to include my schema parsers in the root parser of the included schema which is the root for the xml); by modifying its constructor and _start/end_element methods. It worked fine and now I can parse all the included schemas elements and the root element of my schema (and its sub elements) in the xml file. The problem is: I have many other included schemas in my root element for which I need to make the same way of linking and obviously I need to automate this. My questions: Is there a better way (or other compiling options) to generate a test driver taking into account automatically the root elements of included schemas (putting --root-element my_included_schema_root_element does not work)? I would like to use the test driver as it generates automatically what I need and I would only change the .impl.cxx files for my implementations. PS: Please don't ask me to change the .xsd files as I am not in a position to change them. Thanks a lot! -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Friday, November 22, 2013 12:55 AM To: Latrach, Farhat Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] cxx-parser with --file-per-type Hi Farhat, Latrach, Farhat writes: > First of all, thanks for your great xsd compiler. Thanks, I am glad you like it. > I have a very complicated schemas with many include/import. I tried to > use the cxx-parser with option -file-per-type to ensure of a complete > parser but xsd always ends with runtime error at mid road! I can't say for sure what it wrong without knowing exactly what error you are getting. Having said that, the C++/Parser mapping is meant for simple schemas since you will have to implement a parser for every type yourself. For complex schemas I would recommend you use C++/Tree instead. > Is there any option like -parts of cxx-tree to use with cxx-parser? No. Also, this option won't help you with your issue (complex import/include graphs). Boris This email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please delete all copies and notify the sender immediately. You may wish to refer to the incorporation details of Standard Chartered PLC, Standard Chartered Bank and their subsidiaries at http://www.standardchartered.com/en/incorporation-details.html. From liyubo at dayang.com.cn Thu Nov 21 20:15:08 2013 From: liyubo at dayang.com.cn (liyubo) Date: Thu Nov 21 23:33:54 2013 Subject: [xsd-users] Help, about [2.12.3 Mapping for any with the Sequence Cardinality Class] In-Reply-To: References: <528DE223.2040509@dayang.com.cn> Message-ID: <528EB01A.30506@dayang.com.cn> Deeply appreciated for your great help! Thanks again! 2013-11-22 liyubo ????Boris Kolpackov ?????2013-11-22 00:50 ???Re: [xsd-users] Help, about [2.12.3 Mapping for any with the Sequence Cardinality Class] ????"liyubo" ???"xsd-users" Hi, liyubo writes: > There is no element_sequence like [2.12.3 Mapping for any with the > Sequence Cardinality Class]. Is there anything wrong? Yes, you didn't read the documentation. The first sentence in Section 2.12 clearly states: "For the XML Schema any and anyAttribute wildcards an optional mapping can be requested with the --generate-wildcard option." Boris From hedisen2010 at gmail.com Sat Nov 23 08:24:59 2013 From: hedisen2010 at gmail.com (hedisen2010) Date: Sun Nov 24 23:33:40 2013 Subject: [xsd-users] xsd-tree missing attribute/element content with type of xs:anySimpleType Message-ID: <201311232124512467902@gmail.com> Hello everyone: I've got a problem where using xsd-tree mapping. When I tried to serialization back to xml, the content of a attribute with type of 'xs:anySimpleType' is missing. I can not modify that xml schema file, so I write a small test schema. For generalize reason, attribute 'Type' indicates really data type of 'Value', it may be any xml schema qualified simple type name. Then some test code std::string itemXml( "" ); std::istringstream is(itemXml); std::auto_ptr si( testxsd::SimpleItem(is,xml_schema::flags::dont_validate) ); xml_schema::namespace_infomap nm; nm[""].name = "http://www.example.org/testxsd"; testxsd::SimpleItem(std::cout,*si,nm); Finally I got in output window: Notice that the content of attribute 'Value' is missing. I don't know how to get the content back. Hope for your reply. Thanks. 2013-11-23 Disen He From boris at codesynthesis.com Mon Nov 25 02:36:28 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Nov 25 02:38:53 2013 Subject: [xsd-users] xsd-tree missing attribute/element content with type of xs:anySimpleType In-Reply-To: <201311232124512467902@gmail.com> References: <201311232124512467902@gmail.com> Message-ID: Hi, hedisen2010 writes: > I've got a problem where using xsd-tree mapping. > When I tried to serialization back to xml, the content of a attribute > with type of 'xs:anySimpleType' is missing. See: http://www.codesynthesis.com/pipermail/xsd-users/2008-July/001850.html Boris From boris at codesynthesis.com Mon Nov 25 02:45:46 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Nov 25 02:48:10 2013 Subject: [xsd-users] cxx-parser with --file-per-type In-Reply-To: <7F6839155D74054CB0971462A215DAC915D31FCD@HKWPIPXMB01C> References: <7F6839155D74054CB0971462A215DAC915D31E6E@HKWPIPXMB01C> <7F6839155D74054CB0971462A215DAC915D31FCD@HKWPIPXMB01C> Message-ID: Hi Farhat, Latrach, Farhat writes: > For my case, the cxx-tree does not fit well my need as I still need to parse > the whole tree and for such amount of objects it will be very complicated. I am not sure what you mean by "complicated". IMO, handling a complex schema with C++/Parser is much more complicated than with C++/Tree since you have to implement parsers, connect them, etc. Perhaps what you mean is that parsing a large XML document is not practical because of the memory consumption, etc (this is #1 reason to prefer C++/Parser over C++/Tree). In this case, take a look at the 'streaming' example which shows how to implement streaming parsing with C++/Tree. > The problem is: I have many other included schemas in my root element > for which I need to make the same way of linking and obviously I need > to automate this. > > My questions: > Is there a better way (or other compiling options) to generate a test > driver taking into account automatically the root elements of included > schemas (putting --root-element my_included_schema_root_element does > not work)? As I explained in my previous email, C++/Parser was designed to handle simple, "well designed" schema. It is not meant to handle complex schema with include/import cycles, etc., simply because anyone who decides to use C++/Parser with such a schema will quickly give up because of the amount of work involved in implementing all the parsers. Boris From tolga.tuna at savronik.com.tr Mon Nov 25 03:10:58 2013 From: tolga.tuna at savronik.com.tr (Tolga TUNA) Date: Mon Nov 25 04:24:43 2013 Subject: [xsd-users] Hi Message-ID: <1113347548.559705.1385367058887.JavaMail.root@mail.savronik.com.tr> Hi, I have a problem with encoding of XSD-Tree. Is there a way to add any other encoding types? I want to using ISO-8859-9 or windows-1254. Is it possible? Thank for help. -- Tolga TUNA Sistem M?hendisi Bilgi Sistem M?hendisli?i Entegre ?r?n Programlar? Savunma ve ?r?n Grubu e-posta: tolga.tuna@savronik.com.tr Savronik A.?. Organize Sanayi B?lgesi 10. Cadde No: 10 26110 ESK??EH?R Tel : (+90 222) 236 1590 Faks: (+90 222) 236 1589 www.savronik.com.tr ???????????????????????????. Bu mesaj ve ekleri mesajda g?nderildi?i belirtilen ki?i/ki?ilere ?zeldir ve gizlidir. Bu mesaj?n muhatab? olmaman?za ra?men taraf?n?za ula?m?? olmas? halinde mesaj i?eri?inin gizlili?i ve bu gizlilik y?k?ml?l???ne uyulmas? zorunlulu?u taraf?n?z i?in de s?z konusudur. Mesaj ve eklerinde yer alan bilgilerin do?rulu?u ve g?ncelli?i konusunda g?nderenin ya da ?irketimizin herhangi bir sorumlulu?u bulunmamaktad?r. ?irketimiz mesaj?n ve bilgilerinin size de?i?ikli?e u?rayarak veya ge? ula?mas?ndan, b?t?nl???n?n ve gizlili?inin korunamamas?ndan, vir?s i?ermesinden ve bilgisayar sisteminize verebilece?i herhangi bir zarardan sorumlu tutulamaz. ???????????????????????????. This message and its attachments are confidential, private and are solely those of the author(s). Even if you are not the intended recipient, confidentiality and privacy of the message should be observed. Neither sender(s) nor our company accepts any responsibility for the accuracy or completeness of any information contained in this message and hereby excludes any liability. Our company is not responsible for delays, changes, safety violations, viruses or any potential damages to your computer system caused by the reception of this message. From boris at codesynthesis.com Mon Nov 25 04:39:08 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Nov 25 04:41:36 2013 Subject: [xsd-users] Hi In-Reply-To: <1113347548.559705.1385367058887.JavaMail.root@mail.savronik.com.tr> References: <1113347548.559705.1385367058887.JavaMail.root@mail.savronik.com.tr> Message-ID: Hi Tolga, In the future please use a more descriptive subject for your emails, as discussed in the posting guidelines: http://www.codesynthesis.com/support/posting-guidelines.xhtml Tolga TUNA writes: > I have a problem with encoding of XSD-Tree. Is there a way to add any > other encoding types? I want to using ISO-8859-9 or windows-1254. Is > it possible? I assume you tried to pass one of these values to the serialization functions as discussed in Chapter 6, "Serialization": http://codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#6 If that's the case, then that means your build of Xerces-C++ does not support these encodings. And your options are to either build Xerces-C++ with something like ICU which supports many more encodings or customize Xerces-C++ with your encoding implementation. Boris From tolga.tuna at savronik.com.tr Mon Nov 25 04:53:10 2013 From: tolga.tuna at savronik.com.tr (Tolga TUNA) Date: Mon Nov 25 06:08:05 2013 Subject: [xsd-users] Character Type and Encoding Problem for ISO-8859-9 In-Reply-To: <1508235641.564891.1385372869041.JavaMail.root@mail.savronik.com.tr> Message-ID: <1947447130.565029.1385373190592.JavaMail.root@mail.savronik.com.tr> Hi again, I didn't mean to serilization part. I mention about "http://codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#6" part-3.1 Character Type and Encoding. In that part " Other supported encodings are ISO-8859-1, Xerces-C++ Local Code Page (LPC), as well as custom encodings." was written. I didnt understant how i can do that custom encodings? What is the way of custom encoding? How can i write or find an encoding c++ code? Thanks for trying to help me. -- Tolga TUNA Sistem M?hendisi Bilgi Sistem M?hendisli?i Entegre ?r?n Programlar? Savunma ve ?r?n Grubu e-posta: tolga.tuna@savronik.com.tr Savronik A.?. Organize Sanayi B?lgesi 10. Cadde No: 10 26110 ESK??EH?R Tel : (+90 222) 236 1590 Faks: (+90 222) 236 1589 www.savronik.com.tr ???????????????????????????. Bu mesaj ve ekleri mesajda g?nderildi?i belirtilen ki?i/ki?ilere ?zeldir ve gizlidir. Bu mesaj?n muhatab? olmaman?za ra?men taraf?n?za ula?m?? olmas? halinde mesaj i?eri?inin gizlili?i ve bu gizlilik y?k?ml?l???ne uyulmas? zorunlulu?u taraf?n?z i?in de s?z konusudur. Mesaj ve eklerinde yer alan bilgilerin do?rulu?u ve g?ncelli?i konusunda g?nderenin ya da ?irketimizin herhangi bir sorumlulu?u bulunmamaktad?r. ?irketimiz mesaj?n ve bilgilerinin size de?i?ikli?e u?rayarak veya ge? ula?mas?ndan, b?t?nl???n?n ve gizlili?inin korunamamas?ndan, vir?s i?ermesinden ve bilgisayar sisteminize verebilece?i herhangi bir zarardan sorumlu tutulamaz. ???????????????????????????. This message and its attachments are confidential, private and are solely those of the author(s). Even if you are not the intended recipient, confidentiality and privacy of the message should be observed. Neither sender(s) nor our company accepts any responsibility for the accuracy or completeness of any information contained in this message and hereby excludes any liability. Our company is not responsible for delays, changes, safety violations, viruses or any potential damages to your computer system caused by the reception of this message. From liyubo at dayang.com.cn Tue Nov 26 05:16:42 2013 From: liyubo at dayang.com.cn (liyubo) Date: Tue Nov 26 10:03:21 2013 Subject: [xsd-users] How to apend an anytype child element into the object model Message-ID: <52947508.3080306@dayang.com.cn> Hi, Boris, i have a problem to add a anytype element into the parent model. Here is my schema Comment describing your root element Comment describing your root element The [DataItem] is anyType, and I want append a CDATATEXT section?the code is int main (int argc, char* argv[]) { using namespace xercesc; XMLPlatformUtils::Initialize (); ::DataContents dataContents; DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(L"LS"); DOMDocument* doc = impl->createDocument(0, L"DataItem", 0); DOMElement* eRoot = doc->getDocumentElement(); DOMElement* eText = doc->createElement(L"text"); DOMCDATASection* data = doc->createCDATASection(L"1234567 This is a CDATA!"); eText->appendChild(data); eRoot->appendChild(eText); ::DataContents::DataItem_type item(*eRoot); dataContents.DataItem(item); Data(std::cout, dataContents); XMLPlatformUtils::Terminate (); return 0; } I just use the DOMElement i manually created to init the anytype .The xml_schema::type constructor shows it coulde be created by a DOMElement. But it seems does not work. I don't know how to create the anytype object model, it is only can created by a DOMElement? I also try to use like this xml_schema::type& t (*reinterpret_cast (ae->getUserData (xml_schema::dom::tree_node_key))); in [2.5.2 Mapping for anyType] but it will get a crash,because t get a null. Please help! 2013-11-26 liyubo From boris at codesynthesis.com Wed Nov 27 06:26:50 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Nov 27 06:29:17 2013 Subject: [xsd-users] Re: How to apend an anytype child element into the object model In-Reply-To: <52947508.3080306@dayang.com.cn> References: <52947508.3080306@dayang.com.cn> Message-ID: Hi, liyubo writes: > i have a problem to add a anytype element into the parent model. You will need to customize DataContents class to store the DataItem element in some form (e.g., as DOM elements). Something similar to what is done in the custom/wildcard example. Boris From Tibor.Guba at igate.com Fri Nov 29 08:44:22 2013 From: Tibor.Guba at igate.com (Tibor Guba) Date: Fri Nov 29 08:44:39 2013 Subject: [xsd-users] general enquiry Message-ID: <08fdb55eecc94319b6e4d9a49e111f7f@HKXPR04MB182.apcprd04.prod.outlook.com> Hi, I'm evaluating xsd on behalf of my employer, what we are looking for is an implementation of ebms/as4 light client profile, which is a collection of free standards for b2b messaging. I'm looking into several products to help us implement the transport layer for our application specific messages. For this end I am trying to implement an object model to compose messages, the model is based on public xml schemas such as soap1.1, soap 1.2, and oasis's ebXML messaging, each publicly available standard .xsd-s. As you may be familiar with these standards, they employ wildcards, which I am having problem with, and in need of help, explanation, as what is supported in xsd.exe. I read through several mails in the archive, along with the available documentation. Tried several suggested solution like the -generate-wildcard switch, and customizing the soap Header for instance. I still find it difficult to produce the required xml format messages. Ideally I am looking for a solution where I can add my ebms:Messaging object hierarchy to soap:Header using the any() member or adding a custom messaging() member to my soap Header class without extensive use of xerces-c API, and then serialise the whole message for sending via HTTP. Is this even possible/supported? I am building my message from scratch so no parsed dom is available, even if I'd use keep_dom option. Thanks, Tibor Tibor Guba Technical Specialist [iGATE Logo for Email signature] .......................................................................................................................................................... Office Tel: +353 16722 800 | Guba.Tibor@igate.com | www.igate.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Disclaimer~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Information contained and transmitted by this e-mail is confidential and proprietary to iGATE and its affiliates and is intended for use only by the recipient. If you are not the intended recipient, you are hereby notified that any dissemination, distribution, copying or use of this e-mail is strictly prohibited and you are requested to delete this e-mail immediately and notify the originator or mailadmin@igate.com . iGATE does not enter into any agreement with any party by e-mail. Any views expressed by an individual do not necessarily reflect the view of iGATE. iGATE is not responsible for the consequences of any actions taken on the basis of information provided, through this email. The contents of an attachment to this e-mail may contain software viruses, which could damage your own computer system. While iGATE has taken every reasonable precaution to minimise this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should carry out your own virus checks before opening an attachment. To know more about iGATE please visit www.igate.com . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 6335 bytes Desc: image001.jpg Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20131129/b088206d/image001.jpg