From boris at codesynthesis.com Fri May 3 05:33:39 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri May 3 05:33:46 2013 Subject: [xsd-users] Multiple schemas with the same namespace, compiled into a library In-Reply-To: References: Message-ID: Hi Tony, Tony McConnell writes: > Unfortunately, I need to build an XSD version for a 32 bit platform, > preferably based on the released 3.3.0 source code ... would you have a > patch available for this version to add the different plate capability, or > could you point me to a section of the code please? I only have a patch for the current development version: http://scm.codesynthesis.com/?p=xsd/xsd.git;a=commit;h=bda619aa6ace8ed83d9888ea78f15c7c313c2044 It should apply to 3.3.0 source code except for one thing. We've changed the way we handle command line options so you will have to backport that manually. I can also build you a 32-bit pre-release if you need it. Boris From amnw14545 at googlemail.com Fri May 3 05:28:24 2013 From: amnw14545 at googlemail.com (Tony McConnell) Date: Fri May 3 05:34:02 2013 Subject: [xsd-users] Multiple schemas with the same namespace, compiled into a library In-Reply-To: References: Message-ID: Hi Boris, Thank you again, for this. Unfortunately, I need to build an XSD version for a 32 bit platform, preferably based on the released 3.3.0 source code ... would you have a patch available for this version to add the different plate capability, or could you point me to a section of the code please? I'm building my own XSD 3.3.0 deb package for use within our internal development machine package repository. Performing an ack-grep on the source, to try and find places where plates of 0 might be used in polymorphism code results in: polymorphism/same-type/test.cxx:102: const ::xsd::cxx::tree::type_factory_plate< 0, char > polymorphism/same-type/test.cxx:298: const ::xsd::cxx::tree::std_ostream_plate< 0, char > polymorphism/ostream/test.cxx:176: const ::xsd::cxx::tree::type_factory_plate< 0, char > polymorphism/ostream/test.cxx:632: const ::xsd::cxx::tree::std_ostream_plate< 0, char > polymorphism/comparison/test.cxx:184: const ::xsd::cxx::tree::type_factory_plate< 0, char > polymorphism/comparison/test.cxx:188: const ::xsd::cxx::tree::comparison_plate< 0, char > polymorphism/supermen.cxx:144: const ::xsd::cxx::tree::type_factory_plate< 0, char > polymorphism/supermen.cxx:785: const ::xsd::cxx::tree::type_serializer_plate< 0, char > Is this a good place to start? I can see lots other references to plate templates with parameters of 0, and it looks likely that I could break things very easily! On Thu, Apr 11, 2013 at 4:06 PM, Boris Kolpackov wrote: > Hi Tony, > > Ok, I've implemented this feature and built an x86_64 GNU/Linux binary > for you to try (I assumed that's what you are using, if not, let me know): > > > http://codesynthesis.com/~boris/tmp/xsd/xsd-4.0.0.a12-x86_64-linux-gnu.tar.bz2 > > The new option is --polymorphic-plate . The idea is that you need > assign a different plate (1, 2, 3, etc) to each of your schemas so that > they each get their own set of polymorphic maps. > > Let me know how it goes. > > Boris > From erik.sjolund at gmail.com Sun May 5 12:51:56 2013 From: erik.sjolund at gmail.com (=?ISO-8859-1?Q?Erik_Sj=F6lund?=) Date: Sun May 5 12:52:04 2013 Subject: [xsd-users] is "warning T005" really needed? (use --polymorphic-type to indicate this type is polymorphic ...) In-Reply-To: References: Message-ID: > > XSD issues this warning if a type is used in a substitution group > and the type and substitution group are defined in different files. > Without the --polymorphic-type option when compiling the schema > defining the type, XSD will treat it as non-polymorphic. > > You can also suppress the warning by passing --disable-warning T005. > > Boris > Thanks, Boris! Great, so there is already a command line option for hiding warnings. I totally had missed that. And regarding the functionality around --polymorphic-type and multiple schemas, I think I need to spend some time understanding it better. Right now it it's not quite clear to me. cheers, Erik From Andre.Moreira at helvar.com Wed May 8 10:03:52 2013 From: Andre.Moreira at helvar.com (Moreira Andre) Date: Wed May 8 10:03:57 2013 Subject: [xsd-users] simple tree project Message-ID: <36FE3F160A663D47A0B113E40D656B380D0037@servex10.Service.asp> Hello, I'm in need of some help processing a simple xml file I want to use. I've used the hello example as a source and my project is compiling, but... when I run the executable I get an exception thrown in the constructor and the following error: ":0:0 error: unable to open primary document entity 'C:\...\xCurrUser\Debug'" The xsd I used to generate the source files is this one: I'm using visual studio 2008 and in the C++/Tree Mapping Rules I have enabled t6he following properties -Generate serialization -Generate Default constructors My sample xml file looks like this MyWorkgroup WORKGROUP some short description some short description some short description some short description In my main function, as soon as I call auto_ptr curr_user_profile(CurrentUser_(my_xml_file, xml_schema::flags::dont_validate)); my app breaks. Both xml and xsd files are on the same directory as the executable. I need some help here because I have to say I am quite lost on what the problem might be. Andre Moreira Software Engineer www.helvar.com [Description: helvarFooter] Lighting Control Systems Hawley Mill, Hawley Road, Dartford, Kent, UK, DA2 7SY -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 13351 bytes Desc: image001.jpg Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20130508/5aa31c39/image001.jpg From boris at codesynthesis.com Wed May 8 11:27:37 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed May 8 11:26:31 2013 Subject: [xsd-users] simple tree project In-Reply-To: <36FE3F160A663D47A0B113E40D656B380D0037@servex10.Service.asp> References: <36FE3F160A663D47A0B113E40D656B380D0037@servex10.Service.asp> Message-ID: Hi Andre, Moreira Andre writes: > ":0:0 error: unable to open primary document entity 'C:\...\xCurrUser\Debug'" Is the name of your xml document C:\...\xCurrUser\Debug? That sounds like a directory name to me. > auto_ptr curr_user_profile(CurrentUser_(my_xml_file, xml_schema::flags::dont_validate)); What does the my_xml_file variable contain? You may also find the following recent post relevant to your problem: http://www.codesynthesis.com/pipermail/xsd-users/2013-April/003908.html Boris From Andre.Moreira at helvar.com Fri May 10 04:08:19 2013 From: Andre.Moreira at helvar.com (Moreira Andre) Date: Fri May 10 04:08:23 2013 Subject: [xsd-users] xsd questions Message-ID: <36FE3F160A663D47A0B113E40D656B380D27D7@servex10.Service.asp> Hello I have been evaluating xsd for my company and I built a small prototype that I now want to integrate in our software for further testing and full integration. I have some questions though: 1. How can I "disable" exceptions and use error return codes? 2. When saving an xml file. Does xsd have any built in backup/restore mechanism in case of failure when writing to file? And some problems 3. The project where I want to integrate my prototype uses precompiled headers and I need to add stdafx.h on the header file xsd generates. Can I add this automatically when compiling with xsd? 4. In my integration I am getting 'xercesc_3_1::DOMConfiguration::setParameter' : ambiguous call to overloaded function error , but I added all of the steps as indicated in http://wiki.codesynthesis.com/Using_XSD_with_Microsoft_Visual_Studio. Both projects have the same configuration (in what codesynthesis xsd is concerned), except for the use of precompiled headers. Any ideas? Regards Andre From Andre.Moreira at helvar.com Fri May 10 06:16:06 2013 From: Andre.Moreira at helvar.com (Moreira Andre) Date: Fri May 10 06:16:11 2013 Subject: [xsd-users] Ambiguous call to overloaded function with xsd compiled files Message-ID: <36FE3F160A663D47A0B113E40D656B380D27F6@servex10.Service.asp> Hello, I have a small prototype project that I got working perfectly and I'm trying to include it in my working main project. After adding the xsd compiled files + the schema to my project as soon as the compiler picks up the generated source file I get 1>HelvarProfile.cxx 1>c:\program files (x86)\codesynthesis xsd 3.3\include\xsd\cxx\xml\dom\parsing-source.txx(343) : error C2668: 'xercesc_3_1::DOMConfiguration::setParameter' : ambiguous call to overloaded function 1> c:\program files (x86)\codesynthesis xsd 3.3\include\xercesc\dom\domconfiguration.hpp(391): could be 'void xercesc_3_1::DOMConfiguration::setParameter(const XMLCh *,bool)' 1> c:\program files (x86)\codesynthesis xsd 3.3\include\xercesc\dom\domconfiguration.hpp(390): or 'void xercesc_3_1::DOMConfiguration::setParameter(const XMLCh *,const void *)' 1> while trying to match the argument list '(const XMLCh [], int)' I suspect that this must have something to do with the project properties/configuration as I just copied the generated files from one project to the other. I followed the same steps to configure both projects and as indicated in you page about using xsd with visual studio and everything else seems to be ok. There are many differences between both project configurations and I am concerned that this might be like trying to find a needle in a haystack for something very simple. I would appreciate some help in here as if I can't integrate this quickly I will have to go for other solutions. Best regards Andre Moreira From Andre.Moreira at helvar.com Fri May 10 07:26:22 2013 From: Andre.Moreira at helvar.com (Moreira Andre) Date: Fri May 10 07:26:26 2013 Subject: [xsd-users] RE: Ambiguous call to overloaded function with xsd compiled files Message-ID: <36FE3F160A663D47A0B113E40D656B380D2811@servex10.Service.asp> I have "solved" the ambiguous call to overloaded function problem by going to parsing-source.txx and look for all setParameter that used bool as the second parameter and cast them to (bool). This must be somehow project dependent, but you could probably check that out or just patch the file as well. Now I get unresolved external symbol when linking and I got the same error in my prototype project when "Treat wchar_t as Built-in type" is set to NO(/Zc:wcahr_t-). I guess this has something to do with the way xerces-c_3.lib was compiled. Can you confirm that? Cheers From boris at codesynthesis.com Fri May 10 09:06:32 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri May 10 09:05:20 2013 Subject: [xsd-users] xsd questions In-Reply-To: <36FE3F160A663D47A0B113E40D656B380D27D7@servex10.Service.asp> References: <36FE3F160A663D47A0B113E40D656B380D27D7@servex10.Service.asp> Message-ID: Hi Andre, Moreira Andre writes: > 1. How can I "disable" exceptions and use error return codes? You cannot. XSD can only use exceptions to report errors. You may want to take a look at XSD/e which was especially designed for mobile and embedded projects and allows you to disable the use of exceptions. http://www.codesynthesis.com/products/xsde/ > 2. When saving an xml file. Does xsd have any built in > backup/restore mechanism in case of failure when writing to file? No, XSD does not provide this functionality. What you may want to do is save to a temporary file and then rename it to the actual file as an atomic operations. > 3. The project where I want to integrate my prototype uses > precompiled headers and I need to add stdafx.h on the header file > xsd generates. Can I add this automatically when compiling with xsd? Yes, you can use the --cxx-epilogue option to add the include automatically: --cxx-epilogue "#include \"stdafx.h\"" Boris From boris at codesynthesis.com Fri May 10 09:10:51 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri May 10 09:09:38 2013 Subject: [xsd-users] RE: Ambiguous call to overloaded function with xsd compiled files In-Reply-To: <36FE3F160A663D47A0B113E40D656B380D2811@servex10.Service.asp> References: <36FE3F160A663D47A0B113E40D656B380D2811@servex10.Service.asp> Message-ID: Hi Andre, Moreira Andre writes: > I have "solved" the ambiguous call to overloaded function problem > by going to parsing-source.txx and look for all setParameter that > used bool as the second parameter and cast them to (bool). I believe this is caused by your project redefining true and false as macros (probably as 1 and 0) and when you pass 0 instead of false to setParameter(), the call becomes ambiguous. Needless to say, redefining C++ keywords as macros is a really bad idea. > Now I get unresolved external symbol when linking and I got the same error > in my prototype project when "Treat wchar_t as Built-in type" is set to > NO(/Zc:wcahr_t-). I guess this has something to do with the way > xerces-c_3.lib was compiled. Can you confirm that? Yes, Xerces-C++ and XSD expect the wchar_t to be treated as a built-in type. This is the default and recommended setting in VC++. Boris From adrian.stern at screenfood.com Wed May 15 08:44:34 2013 From: adrian.stern at screenfood.com (Adrian Stern) Date: Wed May 15 08:44:50 2013 Subject: [xsd-users] get string of subtree Message-ID: Hello I have an xml file with signed content. To sign the content the relevant data was taken as a string (in .net) and signed with a private key. Know on another platform I have to check this signature with C++. My questions are: - Can I get the xml-string from a sub tree? (the important question is how) - Why does my IDE (qtcreator seem to be unable to show me any completion info on playlist_sequence (or other _sequences for that matter). I have to join some of the relevant sub trees to one string to check the signature. Freundliche Gr?sse / Best Regards / Meilleures salutations Adrian Stern Diese E-Mail und ihre Anh?nge enthalten vertrauliche und/oder rechtlich gesch?tzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail inklusive Anh?nge. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der Inhalte dieser Mail ist nicht gestattet. This e-mail and any attachments 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 destroy this e-mail including the attachments. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. From boris at codesynthesis.com Wed May 15 15:31:03 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed May 15 15:29:44 2013 Subject: [xsd-users] get string of subtree In-Reply-To: References: Message-ID: Hi Adrian, Adrian Stern writes: > - Can I get the xml-string from a sub tree? (the important question is how) Every XSD-generated class can be serialized into a DOMElement. So the idea is to create a DOMDocument, serialize your sub-tree into it, and finally serialize DOMDocument to string (using std::ostringstream). An example that is the closest to what you are trying to do is 'messaging'. In particular, it shows how to create a DOMDocument instance and how to save it to std::ostream (the function that does that is in the dom-serialize.?xx files). The only bit that will be different in your case is the serialization of the sub-tree. It will look like this: const foo& f = ...; // Your sub-tree. *doc->getDocumentElement () << x; > - Why does my IDE (qtcreator seem to be unable to show me any completion > info on playlist_sequence (or other _sequences for that matter). Probably because it cannot parse/understand the templates that are used to implement sequences. Maybe upgrading to a more recent version will help. Boris From rlischner at proteuseng.com Thu May 16 06:32:37 2013 From: rlischner at proteuseng.com (Ray Lischner) Date: Thu May 16 08:10:24 2013 Subject: [xsd-users] Trouble when not using g++ Message-ID: I am trying to use a non-g++ compiler on Linux (xsd version 3.3.0). When I run make, I choose "3" for the C++ compiler, enter the appropriate options, and I am able to make xsd, but when the makefiles start to compile the tests, the make rules fail to run xsd. Instead, the tests/cxx/parser/built-in test immediately tries to compile driver.cxx, which fails of course because test-pskel.hxx doesn't exist because make hasn't run xsd. I don't understand the build system well enough to debug this. Why doesn't the makefile run xsd when I configure a different compiler, but when I run "make disfigure; make" and choose "1" for the C++ compiler, everything works. Ray Lischner, Distinguished Member of Technical Staff 133 National Business Pkwy, Ste 150 t. 443.539.3448 Annapolis Junction, MD 20701 c. 410.854.9787 rlischner@proteuseng.com f. 443.539.3370 From rlischner at proteuseng.com Thu May 16 07:06:07 2013 From: rlischner at proteuseng.com (Ray Lischner) Date: Thu May 16 08:10:24 2013 Subject: [xsd-users] Cross-compiling xsd Message-ID: We are trying to use xsd in a cross-compile environment. The target system is slower than the host, so what we really want to do is to compile and run xsd on the local host, and then compile and run the tests on the target system. I don't see any easy way to do this, other than to run make on the host, and then to manually change the configuration-dynamic.make files before running make test on the target system. Is there a way that doesn't require manual changes to the configuration-dynamic.make files, so we don't have to hardcode deep knowledge of the build system in our scripts? Ray Lischner, Distinguished Member of Technical Staff 133 National Business Pkwy, Ste 150 t. 443.539.3448 Annapolis Junction, MD 20701 c. 410.854.9787 rlischner@proteuseng.com f. 443.539.3370 From erickfjordan at gmail.com Thu May 16 19:05:56 2013 From: erickfjordan at gmail.com (Erick Jordan) Date: Thu May 16 19:06:04 2013 Subject: [xsd-users] Removal of support for Oracle/Berkeley DB in XSD 4.0.0 Message-ID: Hello, Was wondering if you can suggest an alternative XML DB to use? Thanks Erick From boris at codesynthesis.com Thu May 16 19:23:43 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu May 16 19:22:22 2013 Subject: [xsd-users] Removal of support for Oracle/Berkeley DB in XSD 4.0.0 In-Reply-To: References: Message-ID: Hi Erick, Erick Jordan writes: > Was wondering if you can suggest an alternative XML DB to use? That's a difficult question. The problem with Oracle XML DB is this: originally they used Xerces-C++ underneath and you could actually get access to underlying DOM. This allowed nice integration of XML DB and XSD. However, the XML DB folks decided to change this and get rid of the Xerces-C++-based interface. I had a very long conversation with them (we have a commercial client who uses this combo so it was important), but in the end the XML DB people said that that's the way it is going to be. And with this change there is really no point in maintaining support for integration with XSD (in fact, it would be quite hard to implement the same level of integration/convenience/performance). Now, what would I suggest one should use as an alternative? If you don't need it to be an XML database, then using a relational database (e.g., SQLite) sounds like a natural choice. Of course you would store the actual data rather than the XML representation of it. In this case, you may also want to take a look at ODB: http://www.codesynthesis.com/products/odb/ The idea is that you could generate the C++ classes from XML Schema with XSD and then map them to a relational database with ODB. The end result will be you being able to save the same class either to XML or to a relational database. If, on the other hand, you must use an XML database, then I don't really have any good suggestions. You can still use XML DB with XSD, but you will have to always interface via the XML (text) representation of the data, which will be a lot less convenient or efficient. Boris From boris at codesynthesis.com Thu May 16 19:41:36 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu May 16 19:40:19 2013 Subject: [xsd-users] Trouble when not using g++ In-Reply-To: References: Message-ID: Ray Lischner writes: > I am trying to use a non-g++ compiler on Linux (xsd version 3.3.0). When I > run make, I choose "3" for the C++ compiler, enter the appropriate options, > and I am able to make xsd, but when the makefiles start to compile the > tests, the make rules fail to run xsd. Yes, we have a problem in this case. In a nutshell, when we use a generic C++ compiler, there is no automatic dependency generation support and the XSD compilation is not triggered. In our newer projects (e.g., ODB), we have a solution to this. I can also probably fix it in master if that would help (I think the patch should also apply fairly cleanly to 3.3.0). Boris From boris at codesynthesis.com Thu May 16 19:46:33 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu May 16 19:45:13 2013 Subject: [xsd-users] Cross-compiling xsd In-Reply-To: References: Message-ID: Ray Lischner writes: > We are trying to use xsd in a cross-compile environment. The target > system is slower than the host, so what we really want to do is to > compile and run xsd on the local host, and then compile and run the > tests on the target system. I don't see any easy way to do this, > other than to run make on the host, and then to manually change the > configuration-dynamic.make files before running make test on the > target system. Yes, this use case is not really supported (I don't think even automake would allow you to do something like this). Normally, you would cross- compile XSD for the host, run it, and then cross-compile the generated code for the traget. Then copy the result to the target and run it there. Won't this more canonical approach work for you? Boris From rlischner at proteuseng.com Mon May 20 08:17:06 2013 From: rlischner at proteuseng.com (Ray Lischner) Date: Mon May 20 09:17:36 2013 Subject: [xsd-users] Cross-compiling xsd In-Reply-To: References: , Message-ID: From: Boris Kolpackov [boris@codesynthesis.com] > ... Normally, you would cross- > compile XSD for the host, run it, and then cross-compile the generated > code for the traget. Then copy the result to the target and run it there. > Won't this more canonical approach work for you? I want to run all the tests on the target system. So I need to build xsd natively, run xsd on all the schemas in tests. But I don't want to compile the C++ files in tests/ natively. Either I want to compile them on the target system, or compile them with a different configuration. Is there a make target that runs xsd on all the test schemas, but does not run the C++ compiler to build the test driver programs? Or is there a way to reconfigure the build variables without deleting any object files? I guess I can run the interactive make dialogs and save all the configuration-dynamic.make files for the target, then make disfigure and make again for the host. Run make in xsd. Replace all the configuration-dynamic.make files and run make in tests/. Ray Lischner, Distinguished Member of Technical Staff 133 National Business Pkwy, Ste 150 t. 443.539.3448 Annapolis Junction, MD 20701 c. 410.854.9787 rlischner@proteuseng.com f. 443.539.3370 From boris at codesynthesis.com Mon May 20 10:52:42 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon May 20 10:51:21 2013 Subject: [xsd-users] Cross-compiling xsd In-Reply-To: References: Message-ID: Hi Ray, Ray Lischner writes: > I want to run all the tests on the target system. So I need to build xsd > natively, run xsd on all the schemas in tests. But I don't want to compile > the C++ files in tests/ natively. Either I want to compile them on the > target system, or compile them with a different configuration. Ok, I see the problem. Even if you to cross-compilation of tests, they will have to use a different compiler (one that builds for target, not for host). To support something like this we would have to split the XSD compiler and the test suite into two separate packages. Which may not be a bad idea; we did that with ODB and it works very well. > Is there a make target that runs xsd on all the test schemas, but > does not run the C++ compiler to build the test driver programs? No, there is no such target. > Or is there a way to reconfigure the build variables without deleting any > object files? I guess I can run the interactive make dialogs and save all > the configuration-dynamic.make files for the target, then make disfigure and > make again for the host. Run make in xsd. Replace all the > configuration-dynamic.make files and run make in tests/. Yes, this will work except disfigure will also do clean. So what you will need to do is disfigure the C++ compiler configuration manually. Simply deleting the build/cxx directory should do the trick. Boris From adrian.stern at screenfood.com Tue May 21 08:38:57 2013 From: adrian.stern at screenfood.com (Adrian Stern) Date: Tue May 21 08:39:08 2013 Subject: [xsd-users] get string of subtree In-Reply-To: References: Message-ID: Hi Boris Thanks for your Answer. Good to hear that it is actually a simple task. Could you point me to this example? I'm not able to google it. Do you mean chapter 5 (parsing) in the Guide? http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/ And also are there any "best practices" about how to configure xsdcxx? I've some methods called "methodname_" which is quite ugly and unmeaningly. Thanks for all your help. This is a great product. Freundliche Gr?sse / Best Regards / Meilleures salutations Adrian Stern -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: 15 May 2013 21:31 To: Adrian Stern Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] get string of subtree Hi Adrian, Adrian Stern writes: > - Can I get the xml-string from a sub tree? (the important question > is how) Every XSD-generated class can be serialized into a DOMElement. So the idea is to create a DOMDocument, serialize your sub-tree into it, and finally serialize DOMDocument to string (using std::ostringstream). An example that is the closest to what you are trying to do is 'messaging'. In particular, it shows how to create a DOMDocument instance and how to save it to std::ostream (the function that does that is in the dom-serialize.?xx files). The only bit that will be different in your case is the serialization of the sub-tree. It will look like this: const foo& f = ...; // Your sub-tree. *doc->getDocumentElement () << x; > - Why does my IDE (qtcreator seem to be unable to show me any > completion info on playlist_sequence (or other _sequences for that matter). Probably because it cannot parse/understand the templates that are used to implement sequences. Maybe upgrading to a more recent version will help. Boris Diese E-Mail und ihre Anh?nge enthalten vertrauliche und/oder rechtlich gesch?tzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail inklusive Anh?nge. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der Inhalte dieser Mail ist nicht gestattet. This e-mail and any attachments 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 destroy this e-mail including the attachments. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. From boris at codesynthesis.com Tue May 21 10:12:56 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue May 21 10:11:36 2013 Subject: [xsd-users] get string of subtree In-Reply-To: References: Message-ID: Hi Adrian, Adrian Stern writes: > Could you point me to this example? The example is in the examples/ subdirectory in the XSD distribution. I think you are using a Debian/Ubuntu package in which case the examples should in /usr/share/doc/xsd/examples/. If they are not there, then grab one of the pre-built packages and it will be there. > And also are there any "best practices" about how to configure xsdcxx? There is the Schema Compilation Checklist that covers the basics. http://wiki.codesynthesis.com/XSD/Schema_compilation_checklist > I've some methods called "methodname_" which is quite ugly and unmeaningly. Generally, the approach that I would suggest is to pick something you don't like about the mapping (e.g., methodname_) and then go through the XSD compiler options (man pages but also available on the web) and see which one would allow you to change that. XSD is extremely configurable so chances are good you will find it. Boris From om_codesynthesis at keywallet.com Thu May 23 17:38:39 2013 From: om_codesynthesis at keywallet.com (Ovanes Markarian) Date: Thu May 23 17:39:08 2013 Subject: [xsd-users] Compiling samples on Mac OS X with Clang Message-ID: Hello *, was going to give XSD a try. My dev platform is Mac OS X. I am interested in C++/Parser with an expat binding (no Xerces). I ran the following line for the example located in examples/cxx/parser/hello hello $ make XML_PARSER="expat" CXX="clang++" CPPFLAGS="-I /usr/local/include" LDFLAGS="-L /usr/local/lib" ../../../build/cxx/compilers.make:108: unknown C++ compiler signature 'Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.3.0 Thread model: posix', continuing anyway clang++ -I /usr/local/include -I../../../../libxsd -c driver.cxx -o driver.o In file included from driver.cxx:8: In file included from ./hello-pskel.hxx:62: ../../../../libxsd/xsd/cxx/xml/char-utf8.hxx:13:10: fatal error: 'xercesc/util/XercesDefs.hpp' file not found #include // XMLCh ^ 1 error generated. make: *** [driver.o] Error 1 Thanks for any advice! Ovanes From rlischner at proteuseng.com Thu May 23 15:09:37 2013 From: rlischner at proteuseng.com (Ray Lischner) Date: Thu May 23 18:26:50 2013 Subject: [xsd-users] link with installed archives? Message-ID: Using 3.3.0 on Linux, I am trying to build xsd so it links with installed versions of archives instead of shared objects. The reason is that in our cross-compile environment, there are times when I want to run xsd in an environment where the cross-compiler is installed, along with the cross-compiled versions of boost, xerces, etc., but the native versions of boost, xerces, etc., are not readily available. If I can link everything statically into xsd, it makes my life easier--I have only one file to move around and make available on the system where the cross-compiling will take place. I've tried to change -lboost_date_time to -l:libboost_date_time.a in stub.make, but that doesn't work. I guess the colon interferes with the build system, which clearly uses colons for its own use (e.g., l: -lboost_date_time). I succeeded by changing -lboost_date_time to $(boost_root)/libboost_date_time.a, and adding a definition of boost_root to a configuration-dynamic.make file. This works, but is there an easier way? I would like $(libboost_type) and $(libxerces_c_type) to be used even when I use the "installed" version of imported libraries. Ray Lischner, Distinguished Member of Technical Staff 133 National Business Pkwy, Ste 150 t. 443.539.3448 Annapolis Junction, MD 20701 c. 410.854.9787 rlischner@proteuseng.com f. 443.539.3370 From boris at codesynthesis.com Thu May 23 18:50:36 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu May 23 18:49:21 2013 Subject: [xsd-users] Compiling samples on Mac OS X with Clang In-Reply-To: References: Message-ID: Hi Ovanes, Ovanes Markarian writes: > was going to give XSD a try. My dev platform is Mac OS X. I am interested > in C++/Parser with an expat binding (no Xerces). I ran the following line > for the example located in examples/cxx/parser/hello > > hello $ make XML_PARSER="expat" CXX="clang++" CPPFLAGS="-I > /usr/local/include" LDFLAGS="-L /usr/local/lib" > ../../../build/cxx/compilers.make:108: unknown C++ compiler signature Stock XSD 3.3.0 doesn't recognize Clang. However, there is a patch that adds this support: http://www.codesynthesis.com/~boris/tmp/xsd/xsd-3.3.0-gcc-4.7-clang.patch Simply apply it to stock xsd-3.3.0 binary distribution like this: cd xsd-3.3.0-i686-macosx patch -p1 <.../xsd-3.3.0-gcc-4.7-clang.patch After that everything should build and run without any issues. Boris From boris at codesynthesis.com Thu May 23 19:04:14 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu May 23 19:02:59 2013 Subject: [xsd-users] link with installed archives? In-Reply-To: References: Message-ID: Hi Ray, Ray Lischner writes: > Using 3.3.0 on Linux, I am trying to build xsd so it links with > installed versions of archives instead of shared objects. [...] > > This works, but is there an easier way? The best way is not to have shared versions of the libraries. The linker is hardcoded to prefer shared over static when both are available. You could also override the library search path to only include static libraries: make .LIBPATTERNS=lib%.a This post has more information on this approach: http://codesynthesis.com/pipermail/xsd-users/2013-January/003822.html Boris From Wesley.Peters at tachyon.com Thu May 23 18:55:39 2013 From: Wesley.Peters at tachyon.com (Wesley Peters) Date: Thu May 23 19:03:25 2013 Subject: [xsd-users] Compiling samples on Mac OS X with Clang In-Reply-To: Message-ID: On 5/23/13 3:50 PM, "Boris Kolpackov" wrote: Hi Ovanes, Ovanes Markarian writes: > was going to give XSD a try. My dev platform is Mac OS X. I am interested > in C++/Parser with an expat binding (no Xerces). I ran the following line > for the example located in examples/cxx/parser/hello > > hello $ make XML_PARSER="expat" CXX="clang++" CPPFLAGS="-I > /usr/local/include" LDFLAGS="-L /usr/local/lib" > ../../../build/cxx/compilers.make:108: unknown C++ compiler signature Stock XSD 3.3.0 doesn't recognize Clang. However, there is a patch that adds this support: http://www.codesynthesis.com/~boris/tmp/xsd/xsd-3.3.0-gcc-4.7-clang.patch Simply apply it to stock xsd-3.3.0 binary distribution like this: cd xsd-3.3.0-i686-macosx patch -p1 <.../xsd-3.3.0-gcc-4.7-clang.patch After that everything should build and run without any issues. Nice! Otherwise, you can just compile with GCC on OS X, right? ________________________________ Confidentiality Notice: The information contained in this electronic e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and is confidential and/or privileged. If you and we have a confidentiality agreement or other non-disclosure obligations between us, this Notice shall be deemed to mark and identify the content of this email and any attachments as confidential and proprietary. If any reader of this communication is not the intended recipient, unauthorized use, disclosure or copying is strictly prohibited, and may be unlawful. If you have received this communication in error, please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. IRS Circular 230 Disclosure: To ensure compliance with requirements imposed by the IRS, please be advised that any U.S. federal tax advice contained in this communication (including any attachments) is not intended or written to be used or relied upon, and cannot be used or relied upon, for the purpose of (i) avoiding penalties under the Internal Revenue Code, or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein. E-mail is susceptible to data corruption, interception, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof. From om_codesynthesis at keywallet.com Thu May 23 19:07:21 2013 From: om_codesynthesis at keywallet.com (Ovanes Markarian) Date: Thu May 23 19:07:49 2013 Subject: [xsd-users] Compiling samples on Mac OS X with Clang In-Reply-To: References: Message-ID: Hello Boris, many thanks for your prompt support. Please see the issues below: On Fri, May 24, 2013 at 12:50 AM, Boris Kolpackov wrote: > Hi Ovanes, > > Ovanes Markarian writes: > > > was going to give XSD a try. My dev platform is Mac OS X. I am interested > > in C++/Parser with an expat binding (no Xerces). I ran the following line > > for the example located in examples/cxx/parser/hello > > > > hello $ make XML_PARSER="expat" CXX="clang++" CPPFLAGS="-I > > /usr/local/include" LDFLAGS="-L /usr/local/lib" > > ../../../build/cxx/compilers.make:108: unknown C++ compiler signature > > Stock XSD 3.3.0 doesn't recognize Clang. However, there is a patch that > adds this support: > > http://www.codesynthesis.com/~boris/tmp/xsd/xsd-3.3.0-gcc-4.7-clang.patch > > Simply apply it to stock xsd-3.3.0 binary distribution like this: > > cd xsd-3.3.0-i686-macosx > patch -p1 <.../xsd-3.3.0-gcc-4.7-clang.patch > > After that everything should build and run without any issues. I did it as suggested: xsd-3.3.0-i686-macosx $ patch -p1 < ../xsd-3.3.0-gcc-4.7-clang.patch patching file examples/build/cxx/compilers.make patching file examples/build/cxx/rules.make patching file libxsd/xsd/cxx/parser/expat/elements.txx patching file libxsd/xsd/cxx/parser/non-validating/parser.txx patching file libxsd/xsd/cxx/parser/non-validating/xml-schema-pskel.txx patching file libxsd/xsd/cxx/parser/validating/parser.txx patching file libxsd/xsd/cxx/parser/validating/xml-schema-pskel.txx patching file libxsd/xsd/cxx/tree/parsing.txx patching file libxsd/xsd/cxx/tree/stream-extraction.hxx patching file libxsd/xsd/cxx/zc-istream.txx mbprr:xsd-3.3.0-i686-macosx $ cd examples/cxx/ parser/ tree/ mbprr:xsd-3.3.0-i686-macosx $ cd examples/cxx/tree/hello/ mbprr:hello $ ll total 40 drwxr-xr-x@ 7 ovanes staff 238 Apr 26 2010 . drwxr-xr-x@ 20 ovanes staff 680 Apr 26 2010 .. -rw-r--r--@ 1 ovanes staff 818 Jul 29 2007 README -rw-r--r--@ 1 ovanes staff 718 Jul 23 2007 driver.cxx -rw-r--r--@ 1 ovanes staff 391 Jan 27 2006 hello.xml -rw-r--r--@ 1 ovanes staff 1408 Jul 23 2007 hello.xsd -rw-r--r--@ 1 ovanes staff 372 Jan 27 2006 makefile mbprr:hello $ make XML_PARSER="expat" CXX="clang++" CPPFLAGS="-I /usr/local/include" LDFLAGS="-L /usr/local/lib" ../../../build/cxx/compilers.make:122: unknown C++ compiler signature 'Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.3.0 Thread model: posix', continuing anyway ../../../../bin/xsd cxx-tree hello.xsd clang++ -I /usr/local/include -I../../../../libxsd -c driver.cxx -o driver.o In file included from driver.cxx:8: In file included from ./hello.hxx:58: ../../../../libxsd/xsd/cxx/xml/char-utf8.hxx:13:10: fatal error: 'xercesc/util/XercesDefs.hpp' file not found #include // XMLCh ^ 1 error generated. make: *** [driver.o] Error 1 I installed expat using Homebrew into /usr/local{include,lib} and also pass these paths to compiler. As you can see with no luck. Many thanks, Ovanes From boris at codesynthesis.com Thu May 23 19:17:59 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu May 23 19:17:04 2013 Subject: [xsd-users] Compiling samples on Mac OS X with Clang In-Reply-To: References: Message-ID: Hi Ovanes, Ovanes Markarian writes: > mbprr:xsd-3.3.0-i686-macosx $ cd examples/cxx/tree/hello/ I thought you are interested in the C++/Parser mapping? Only C++/Parser can use Expat as the underlying XML parser. C++/Tree always uses Xerces-C++. > ../../../build/cxx/compilers.make:122: unknown C++ compiler signature > 'Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) Target: > x86_64-apple-darwin12.3.0 Thread model: posix', continuing anyway Hm, looks like Apple changed the signature of the default Clang. This should still work, however, if you build examples in cxx/parser/. Boris From om_codesynthesis at keywallet.com Thu May 23 19:24:32 2013 From: om_codesynthesis at keywallet.com (Ovanes Markarian) Date: Thu May 23 19:25:01 2013 Subject: [xsd-users] Compiling samples on Mac OS X with Clang In-Reply-To: References: Message-ID: On Fri, May 24, 2013 at 1:17 AM, Boris Kolpackov wrote: > I thought you are interested in the C++/Parser mapping? Only > C++/Parser can use Expat as the underlying XML parser. C++/Tree > always uses Xerces-C++. > > Yes sorry! Just oversaw the right directory by cd-ing back to 'hello' > > > ../../../build/cxx/compilers.make:122: unknown C++ compiler signature > > 'Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) Target: > > x86_64-apple-darwin12.3.0 Thread model: posix', continuing anyway > > Hm, looks like Apple changed the signature of the default Clang. This > should still work, however, if you build examples in cxx/parser/. > Now I ran make in the right directory: hello $ make XML_PARSER=expat CXX="clang" CPPFLAGS="-I /usr/local/include" LDFLAGS="-L /usr/local/lib" ../../../build/cxx/compilers.make:122: unknown C++ compiler signature 'Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.3.0 Thread model: posix', continuing anyway clang -I /usr/local/include -I../../../../libxsd -c driver.cxx -o driver.o In file included from driver.cxx:8: In file included from ./hello-pskel.hxx:62: ../../../../libxsd/xsd/cxx/xml/char-utf8.hxx:13:10: fatal error: 'xercesc/util/XercesDefs.hpp' file not found #include // XMLCh ^ 1 error generated. make: *** [driver.o] Error 1 mbprr:hello $ pwd /Users/ovanes/Downloads/xsd-3.3.0-i686-macosx/examples/cxx/parser/hello Thanks, Ovanes From boris at codesynthesis.com Thu May 23 20:41:40 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu May 23 20:40:24 2013 Subject: [xsd-users] Compiling samples on Mac OS X with Clang In-Reply-To: References: Message-ID: Hi Ovanes, Ovanes Markarian writes: > Now I ran make in the right directory: > hello $ make XML_PARSER=expat CXX="clang" CPPFLAGS="-I /usr/local/include" > LDFLAGS="-L /usr/local/lib" I think you have old generated files (-pskel.?xx) which were produced with Xerces-C++ support. Try running make clean before building. Also, you need to use clang++, not clang in the CXX variable. Boris From om_codesynthesis at keywallet.com Fri May 24 03:54:52 2013 From: om_codesynthesis at keywallet.com (Ovanes Markarian) Date: Fri May 24 03:55:21 2013 Subject: [xsd-users] Compiling samples on Mac OS X with Clang In-Reply-To: References: Message-ID: On Fri, May 24, 2013 at 2:41 AM, Boris Kolpackov wrote: > I think you have old generated files (-pskel.?xx) which were produced > with Xerces-C++ support. Try running make clean before building. Also, > you need to use clang++, not clang in the CXX variable. > Boris, thanks a lot! Worked like a charm! Best Regards, Ovanes From adrian.stern at screenfood.com Mon May 27 10:48:10 2013 From: adrian.stern at screenfood.com (Adrian Stern) Date: Mon May 27 10:48:25 2013 Subject: [xsd-users] unable to load file with --suppress-parsing activated Message-ID: Hi As i understand i do not need the parsing ability since i intend to load the whole document to ram (cxx-tree/DOM). So i disabled the generation of the parsing methods with --suppress-parsing which rendered my code invalid. This code worked with parsing abut not without: ====================================================== auto_ptr s; try{ s = special_smil_("/tmp/content.xml", xml_schema::flags::dont_validate); }catch(const xml_schema::exception& e){ cerr << "could not load xml" << endl; return; } // print ids of playlists in xml playlist_seq& ps (s->playlists().playlist()); for (playlist_itr i (ps.begin ()); i != ps.end (); ++i){ playlist_t& p (*i); cout << "id: " << p.id() << endl; } ====================================================== Without parsing I am unable to figure out how to load my content.xml. I tried the following code, which is basically the same as in one of the examples but I always get this strange error which basically says nothing. ====================================================== auto_ptr s (special_smil(c)); playlist_seq& ps (s->playlists().playlist()); // error here main.cpp:47: error: request for member 'playlists' in 's', which is of non-class type 'std::auto_ptr(special_smil)' ====================================================== I guess something is going on while loading but without any output. Any ideas? All I want is to simply load my Xml file and iterate trough it while maintaining it in memory since later on there will be several cycles of iteration to read the whole file. My xsd file: http://pastebin.com/cYxgXwtT My xml file: http://pastebin.com/cFN6N8Q8 Dsig file: http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd xsdcxx cxx-tree --cxx-suffix .cpp --hxx-suffix .h --proprietary-license --suppress-parsing --root-element special-smil --namespace-map "http://www.w3.org/2000/09/xmldsig#=ds" --show-sloc screenfood-0.2.xsd xsdcxx cxx-tree --cxx-suffix .cpp --hxx-suffix .h --proprietary-license --suppress-parsing --root-element Signature --namespace-map "http://www.w3.org/2000/09/xmldsig#=ds" --show-sloc xmldsig-core-schema.xsd Thanks for any help. I have to get a grip to this tool. Freundliche Gr?sse / Best Regards / Meilleures salutations Adrian Stern Diese E-Mail und ihre Anh?nge enthalten vertrauliche und/oder rechtlich gesch?tzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail inklusive Anh?nge. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der Inhalte dieser Mail ist nicht gestattet. This e-mail and any attachments 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 destroy this e-mail including the attachments. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. From boris at codesynthesis.com Mon May 27 19:30:46 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon May 27 19:29:48 2013 Subject: [xsd-users] unable to load file with --suppress-parsing activated In-Reply-To: References: Message-ID: Hi Adrian, Adrian Stern writes: > As i understand i do not need the parsing ability since i intend to > load the whole document to ram (cxx-tree/DOM). No, you still need it. Disabling parsing will omit both the parsing constructors (what you need) and parsing functions (what you don't need). To disable just parsing functions you can use the --root-element-none option. Boris From adrian.stern at screenfood.com Tue May 28 02:44:47 2013 From: adrian.stern at screenfood.com (Adrian Stern) Date: Tue May 28 02:45:00 2013 Subject: [xsd-users] unable to load file with with validation Message-ID: Hi Boris, So then parsing is an fact for the whole loading process, while serializing is for the saving process. Thanks again. Also I figured out how to rename my special_smil_ class. Problem was the type naming in xsd which had to be changed a bit. If I don't set xml_schema::flags::don't_validate I still can't load my file. Validating my xml against my xsd in a online tool says that everything is ok. Can I somehow check my files with xsdcxx and output me some info? Freundliche Gr?sse / Best Regards / Meilleures salutations Adrian Stern ______________ Adrian Stern Software Developer -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: 28 May 2013 01:31 To: Adrian Stern Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] unable to load file with --suppress-parsing activated Hi Adrian, Adrian Stern writes: > As i understand i do not need the parsing ability since i intend to > load the whole document to ram (cxx-tree/DOM). No, you still need it. Disabling parsing will omit both the parsing constructors (what you need) and parsing functions (what you don't need). To disable just parsing functions you can use the --root-element-none option. Boris Diese E-Mail und ihre Anh?nge enthalten vertrauliche und/oder rechtlich gesch?tzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail inklusive Anh?nge. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der Inhalte dieser Mail ist nicht gestattet. This e-mail and any attachments 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 destroy this e-mail including the attachments. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. From boris at codesynthesis.com Tue May 28 07:42:00 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue May 28 07:40:46 2013 Subject: [xsd-users] unable to load file with with validation In-Reply-To: References: Message-ID: Hi Adrian, Adrian Stern writes: > If I don't set xml_schema::flags::don't_validate I still can't load my > file. Validating my xml against my xsd in a online tool says that > everything is ok. In this case it is most likely due to the schema not being found during parsing. Check Section 5.1, "XML Schema Validation and Searching" in the C++/Tree Mapping Getting Started Guide. Boris