From look2006il at gmail.com Mon Jul 15 03:03:41 2013 From: look2006il at gmail.com (maxim maxim) Date: Mon Jul 15 03:03:48 2013 Subject: [xsde-users] (no subject) Message-ID: Hi guys, I'm a new user of CodeSynthesis XSD/e, someone could explain me please how I can to validate some *.xml file , which I accept as the string form against schema *.xsd file? I need some examples of code how I can do it in C++. Best Regards, Maxim From look2006il at gmail.com Mon Jul 15 09:46:00 2013 From: look2006il at gmail.com (maxim maxim) Date: Mon Jul 15 09:46:08 2013 Subject: [xsde-users] Boost-jam Message-ID: I'm trying to install XSD/e package, I'm using for this purpose installation guide from http://www.codesynthesis.com/projects/xsd/extras/build-unix.xhtml. The link for Boost-jam does not work( it has the same location for the boost library), does it(Boost-jam ) something that must be installed or not? Could someone please explain me for what purpose we need boost and Boost-jam libraries? Best Regards, Maxim From boris at codesynthesis.com Tue Jul 16 06:41:31 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jul 16 06:41:43 2013 Subject: [xsde-users] Boost-jam In-Reply-To: References: Message-ID: Hi, maxim maxim writes: > I'm trying to install XSD/e package, I'm using for this purpose > installation guide from > http://www.codesynthesis.com/projects/xsd/extras/build-unix.xhtml. Why are you trying to build the XSD/e compiler yourself? Instead, download the binary package for your platform and follow the instructions in the INSTALL file that comes inside on how to build the runtime, examples, etc. Boris From look2006il at gmail.com Tue Jul 23 12:38:35 2013 From: look2006il at gmail.com (maxim maxim) Date: Tue Jul 23 13:21:47 2013 Subject: [xsde-users] hello example parser with std Message-ID: Hello to all users, I'm trying to run hello parser example, but instead of the doc_p.parse ("hello.xml"); I'm using with std::string as following: std::string contents; std::ifstream in("hello.xml", std::ios::in | std::ios::binary); if (in) { in.seekg(0, std::ios::end); contents.resize(in.tellg()); in.seekg(0, std::ios::beg); in.read(&contents[0], contents.size()); in.close(); } doc_p.parse (contents); But after running doc_p.parse (contents); I have the following error : terminate called after throwing an instance of 'std::ios_base::failure' what(): basic_ios::clear Anybody could help me with it, why is it happening, and how I can resolve it? Thanks, Maxim From boris at codesynthesis.com Wed Jul 24 03:41:24 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jul 24 03:41:54 2013 Subject: [xsde-users] hello example parser with std In-Reply-To: References: Message-ID: Hi Maxim, maxim maxim writes: > std::string contents; > std::ifstream in("hello.xml", std::ios::in | std::ios::binary); > if (in) > { > in.seekg(0, std::ios::end); > contents.resize(in.tellg()); > in.seekg(0, std::ios::beg); > in.read(&contents[0], contents.size()); > in.close(); > } > doc_p.parse (contents); If doc_p.parse ("hello.xml"); treats its argument as a file name, what do you think this call will treat it as? std::string s; ... doc_p.parse (s); I think it is pretty clear it will still treat it as a file name (no, calling it 'contents' doesn't help). If you want to parse a chunk of memory, you can do something like this: std::string s; ... doc_p.parse (s.c_str (), s.size (), true); See documentation for more information. Boris From look2006il at gmail.com Sat Jul 27 13:33:33 2013 From: look2006il at gmail.com (maxim maxim) Date: Mon Jul 29 05:54:06 2013 Subject: [xsde-users] hello example parser with std In-Reply-To: References: Message-ID: Thank you Boris. I create some xml file that appropriates to my schema *.xsd on visual studio, the problem when I'm running it on xsde I see the error in the above file with the same schema. I don't suceed to understand why it's happening. My question is how I can compile xsd/e library if I want to see the source code of library in debugging time? BR, Maxim 2013/7/24 Boris Kolpackov > Hi Maxim, > > maxim maxim writes: > > > std::string contents; > > std::ifstream in("hello.xml", std::ios::in | std::ios::binary); > > if (in) > > { > > in.seekg(0, std::ios::end); > > contents.resize(in.tellg()); > > in.seekg(0, std::ios::beg); > > in.read(&contents[0], contents.size()); > > in.close(); > > } > > doc_p.parse (contents); > > If > > doc_p.parse ("hello.xml"); > > treats its argument as a file name, what do you think this call will > treat it as? > > std::string s; > ... > doc_p.parse (s); > > I think it is pretty clear it will still treat it as a file name > (no, calling it 'contents' doesn't help). > > If you want to parse a chunk of memory, you can do something like > this: > > std::string s; > ... > doc_p.parse (s.c_str (), s.size (), true); > > See documentation for more information. > > Boris >