From boris at codesynthesis.com Thu Dec 1 07:36:42 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Dec 1 07:44:44 2011 Subject: EXTERNAL: Re: [xsd-users] Way To Determine Fully Qualified Type? In-Reply-To: References: Message-ID: Hi Jason, Friess, Jason writes: > We do have polymorphism enabled and the type in question is derived > from a polymorphic base. We are very interested in an approach you > can point us to to get this information! The other requirement that I forgot to mention is that you need to generate serialization support (--generate-serialization) since internally this information is only needed for serialization. If all the requirements are met, then you can use the schema_type() function I wrote: http://www.codesynthesis.com/~boris/tmp/xsd/schema-type.tar.gz It returns polymorphic type schema name in the form "namespace#name". If there is no entry for this type, then it returns an empty string: #include "schema-type.hxx" type& x = ... // Some XSD-generated polymorphic class instance. std::string type (schema_type (x)); It should be pretty straightforward to modify this function if you need the namespace/name parts returned separately (e.g.. as std::pair). Boris From bhartsb at gmail.com Thu Dec 1 15:58:25 2011 From: bhartsb at gmail.com (B Hart) Date: Thu Dec 1 15:58:35 2011 Subject: [xsd-users] tag files and doxygen Message-ID: Hello, I generated documentation for the XSD runtime (using doxygen GUI app) located at: C:/Program Files/CodeSynthesis XSD 3.3/documentation/cxx/tree/reference. This created a file libxsd.doxytag as well as html documentation. I also created documentation of my XSD generated .hxx and .cxx files. However, I don't understand from the help file (at : http://www.stack.nl/~dimitri/doxygen/doxytag_usage.html ) how to use the tag file to link the XSD runtime documentation to my XSD .hxx and .cxx documentation. Do I have to modify my .hxx and .cxx and re-run doxygen? Thanks in advance. From boris at codesynthesis.com Fri Dec 2 06:18:46 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Dec 2 06:26:59 2011 Subject: [xsd-users] tag files and doxygen In-Reply-To: References: Message-ID: Hi Brian, B Hart writes: > I generated documentation for the XSD runtime (using doxygen GUI app) > located at: C:/Program Files/CodeSynthesis XSD > 3.3/documentation/cxx/tree/reference. > > This created a file libxsd.doxytag as well as html documentation. > > I also created documentation of my XSD generated .hxx and .cxx files. > > However, I don't understand from the help file (at : > http://www.stack.nl/~dimitri/doxygen/doxytag_usage.html ) > how to use the tag file to link the XSD runtime documentation to my XSD > .hxx and .cxx documentation. To link to the XSD runtime documentation you need to update the TAGFILES variable in your project's .doxygen file. Here are the step-by-step instructions based on the hello example: 1. Generate libxsd documentation in the documentation/cxx/tree/reference directory. You can use either the provided makefile, a GUI tool, or command line. 2. In the hello example directory (examples/cxx/tree/hello) compile the schema with --generate-doxygen. 3. Generate .doxygen file for the hello example. Using command line this will be: doxygen -g hello.doxygen 4. Edit the gneerated hello.doxygen file and change the TAGFILES variable to read: TAGFILES = ../../../../documentation/cxx/tree/reference/libxsd.doxytag=../../../../documentation/cxx/tree/reference/html 5. Generate the documentation for the hello example. Using command line this will be: doxygen hello.doxygen Now examples/cxx/tree/hello/html and documentation/cxx/tree/reference/html will be linked. Boris From dkodko at yahoo.com Sun Dec 4 01:10:27 2011 From: dkodko at yahoo.com (dd ddd) Date: Sun Dec 4 01:11:50 2011 Subject: [xsd-users] Re: Fwd: How are you?! Message-ID: <1322979027.62705.androidMobile@web45306.mail.sp1.yahoo.com>

Hola...
I had tried everything finding this was the greatest thing thats ever happened my success was effortless just think of all the possibilities
http://virtualbook.web.fc2.com/profile/27PhilipDavies/
bye.

From vishkale at gmail.com Fri Dec 2 18:02:35 2011 From: vishkale at gmail.com (Vishwanath Kale) Date: Sun Dec 4 07:47:48 2011 Subject: [xsd-users] Program Crash with message : basic_string::_S_construct null not valid Message-ID: Hi, When trying to run the program (open SRC SRGS code) I got the error/assertion which indicates that the failure occurred in file grammar.cxx line 147, function doc_p.parse... The message says "basic_string::_S_construct null not valid." Here's the snippet of the code. The full src file with few other files is attached to email as well. parser::grammar grammar_p; grammar_p.parsers(rule_p, lexicon_p, meta_p, string_p, tag_p, Tag_format_datatype_p, Version_datatype_p, lang_p, string_p, // base Root_datatype_p, Mode_datatype_p); // Parse the XML instance document. xml_schema::parser::document doc_p( grammar_p, "http://www.w3.org/2001/06/grammar", // root element namespace "grammar"); // root element name gram = doc_p.parse("C:\\Work\\SRGS_Parser\\SRGS_Loader\\Debug\\mode-dtmf.grxml", flags); Following versions of the products i am using: xsd : xsd-2.3.0-i686-windows xerces : xerces-c-src_2_8_0 Operating system name and version: Windows XP Prof. Ver 2002, SP 3 IDE: Eclipse CDT C++ compiler name and version: Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=c:/work/devtools/mingw/bin/../libexec/gcc/mingw32/4.6.1/lto-wrapper.exe Target: mingw32 Configured with: ../gcc-4.6.1/configure --enable-languages=c,c++,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw Thread model: win32 gcc version 4.6.1 (GCC) Any help will greatly appreciated! Thank you -------------- next part -------------- A non-text attachment was scrubbed... Name: srgs.zip Type: application/zip Size: 35384 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20111202/f19c1f75/srgs-0001.zip From boris at codesynthesis.com Sun Dec 4 07:58:53 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Dec 4 08:07:38 2011 Subject: [xsd-users] Program Crash with message : basic_string::_S_construct null not valid In-Reply-To: References: Message-ID: Hi Vishwanath, Vishwanath Kale writes: > xsd : xsd-2.3.0-i686-windows This is a very, very old version of XSD. You may want to consider upgrading, though the C++/Parser mapping in XSD 3-series is quite different compared to XSD 2.3.0. So you may have to make quite a few changes to your code. > The full src file with few other files is attached to email as well. I couldn't try your code sine it doesn't include the test driver (i.e., the source file with main()). If you want me to investigate this further, then you will need to send me (off list) a complete test. Boris From sampada.patil1 at gmail.com Mon Dec 5 10:09:24 2011 From: sampada.patil1 at gmail.com (Sampada Patil) Date: Mon Dec 5 10:09:35 2011 Subject: [xsd-users] xsd tree - Error while integrating hxx into c++ file. Message-ID: Hi, I am new to xsd tree. I could able to create cxx, hxx files from xsd. But when i try to integrate it into c++ file i am getting following errors in .hxx file- error C2143: syntax error : missing '}' before 'string' error C2143: syntax error : missing ';' before '}' error C2238: unexpected token(s) preceding ';' error C2146: syntax error : missing ')' before identifier 'v' error C2146: syntax error : missing ';' before identifier 'v' error C2059: syntax error : ')' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2062: type 'const char' unexpected error C2226: syntax error : unexpected type 'std::string' error C2226: syntax error : unexpected type 'xml_schema::string' error C2226: syntax error : unexpected type 'xercesc_3_1::DOMElement' error C2226: syntax error : unexpected type 'xercesc_3_1::DOMAttr' error C2226: syntax error : unexpected type 'std::string' error C2226: syntax error : unexpected type 'edf::Flight::BookingInfoGTEnum' error C2270: '_clone' : modifiers not allowed on nonmember functions error C2146: syntax error : missing ')' before identifier 'v' error C2059: syntax error : ')' error C2833: 'operator value' is not a recognized operator or type warning C4091: 'virtual ' : ignored on left of 'int' when no variable is declared error C2143: syntax error : missing ';' before 'newline' error C2059: syntax error : 'newline' error C2143: syntax error : missing ';' before '{' error C2447: '{' : missing function header (old-style formal list?) error C2059: syntax error : 'protected' error C2146: syntax error : missing ';' before identifier '_xsd_BookingInfoGTEnum_convert' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2371: 'edf::Flight::value' : redefinition; different basic types 1422) : see declaration of 'edf::Flight::value' error C2270: '_xsd_BookingInfoGTEnum_convert' : modifiers not allowed on nonmember functions error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2059: syntax error : 'public' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2146: syntax error : missing ';' before identifier '_xsd_BookingInfoGTEnum_indexes_' error C2373: 'edf::Flight::value' : redefinition; different type modifiers 1422) : see declaration of 'edf::Flight::value' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2143: syntax error : missing '}' before ',' error C2059: syntax error : ',' error C2143: syntax error : missing ';' before '}' error C2238: unexpected token(s) preceding ';' error C2146: syntax error : missing ')' before identifier 'v' error C2146: syntax error : missing ';' before identifier 'v' error C2059: syntax error : ')' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2062: type 'const char' unexpected error C2226: syntax error : unexpected type 'std::string' error C2226: syntax error : unexpected type 'xml_schema::string' error C2226: syntax error : unexpected type 'xercesc_3_1::DOMElement' error C2226: syntax error : unexpected type 'xercesc_3_1::DOMAttr' error C2226: syntax error : unexpected type 'std::string' error C2226: syntax error : unexpected type 'edf::ExtraGlobalTypeEnum' error C2270: '_clone' : modifiers not allowed on nonmember functions error C2146: syntax error : missing ')' before identifier 'v' error C2059: syntax error : ')' error C2833: 'operator value' is not a recognized operator or type warning C4091: 'virtual ' : ignored on left of 'int' when no variable is declared error C2143: syntax error : missing ';' before 'newline' error C2059: syntax error : 'newline' error C2143: syntax error : missing ';' before '{' error C2447: '{' : missing function header (old-style formal list?) error C2059: syntax error : 'protected' error C2146: syntax error : missing ';' before identifier '_xsd_ExtraGlobalTypeEnum_convert' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2371: 'edf::value' : redefinition; different basic types 1752) : see declaration of 'edf::value' error C2270: '_xsd_ExtraGlobalTypeEnum_convert' : modifiers not allowed on nonmember functions error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2059: syntax error : 'public' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2146: syntax error : missing ';' before identifier '_xsd_ExtraGlobalTypeEnum_indexes_' error C2373: 'edf::value' : redefinition; different type modifiers 1752) : see declaration of 'edf::value' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2504: 'edf::Flight::PersonTypeEnum' : base class undefined error C2027: use of undefined type 'edf::Flight::PersonTypeEnum' 256) : see declaration of 'edf::Flight::PersonTypeEnum' error C2146: syntax error : missing ';' before identifier 'value' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2602: 'PersonType::value' is not a member of a base class of 'PersonType' 3626) : see declaration of 'PersonType::value' 3623) : see declaration of 'PersonType' error C2868: 'PersonType::value' : illegal syntax for using-declaration; expected qualified-name error C2059: syntax error : '}' error C2143: syntax error : missing ';' before '}' error C2059: syntax error : '}' error C2143: syntax error : missing ';' before '}' error C2059: syntax error : '}' error C2143: syntax error : missing ';' before '{' error C2447: '{' : missing function header (old-style formal list?) Can you please tell me, what wrong i am doing here? Thanks and regards, Sampada From DLickert at testo.de Mon Dec 5 08:56:07 2011 From: DLickert at testo.de (Lickert, Dominik (LEN, DivHG)) Date: Mon Dec 5 11:53:57 2011 Subject: [xsd-users] Convert a type, created by the xsd-tool, to DOMElement type, defined in xerces Message-ID: <7F3DD1431E490D4DB37C698C3EED6F3014A98D6755@TESTOEX001.cds.testo> Hi Boris, My problem is, that I want to read out the content / NodeValue of an element, but there is no function in the generated code for that. The element I mean is the "Text" element. I printed the three types, where it occurs in the xsd file and a part of the xml file: (The Shape_Type bases on the ShapeSheet_Type) ==> <== ... Short part of the XML file: - - + + + + + ... - Task In the xsd file, it isn't defined, that the "Text" element can have an content. I look up in the hello example and in the wildcard example. But the two methods of this projects don't work. The wildcard project convert a any_iterator in a DOMElement. Is this also possible with a no-any_type? My compiler don't accept this. I tried it with the following code, but the "Text" element isn't a any_type, only a few any_type occurring here. core:: Shape_Type::any_sequence& AnySeqShape (ShapeT->any()); for(core:: Shape_Type::any_iterator AnyIt (AnySeqShape.begin()); AnyIt != AnySeqShape.end(); AnyIt++) { DOMElement& e (*AnyIt); string name (xml::transcode (e.getLocalName ())); cout << "- " << name << endl; XMLString::release(&name); } So I tried it with the following code, but the compiler don't accept the second line of the for-loop. Only the first one works, but with that conversion, I can't access to the content of the element. core::Shape_Type::Text_sequence& TxtSeq (&ShapeT->Text()); for(core::Shape_Type::Text_iterator TxtIt (TxtSeq.begin()); TxtIt != TxtSeq.end(); TxtIt++) { core::Shape_Type::Text_type* TxtTy = dynamic_cast (&*TxtIt); DOMElement& DomElem (*TxtIt); } Is this actually the right way, or Is there another way to read out the content of an element in a string or char variable? Best Regards Dominik Testo AG, Lenzkirch, Commercial Register Freiburg 320456 - Board of Directors: Burkart Knospe (CEO), Lothar Walleser, Martin Winkle, Dr. J?rk Hebenstreit- Supervisory board: Anne-Kathrin Deutrich (Chairperson), Klaus Fritzsching, Hartmut Herrlinger, Testo AG, Testo-Strasse 1, 79853 Lenzkirch, Germany From boris at codesynthesis.com Mon Dec 5 11:50:00 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Dec 5 11:59:01 2011 Subject: [xsd-users] Re: Convert a type, created by the xsd-tool, to DOMElement type, defined in xerces In-Reply-To: <7F3DD1431E490D4DB37C698C3EED6F3014A98D6755@TESTOEX001.cds.testo> References: <7F3DD1431E490D4DB37C698C3EED6F3014A98D6755@TESTOEX001.cds.testo> Message-ID: Hi Dominik, Lickert, Dominik (LEN, DivHG) writes: > My problem is, that I want to read out the content / NodeValue of > an element, but there is no function in the generated code for that. > > > > > > This type has mixed content. Please refer to the 'mixed' example for more information on how to access its content. Boris From boris at codesynthesis.com Mon Dec 5 11:54:03 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Dec 5 12:03:01 2011 Subject: [xsd-users] xsd tree - Error while integrating hxx into c++ file. In-Reply-To: References: Message-ID: Hi Sampada, Sampada Patil writes: > But when i try to integrate it into c++ file i am getting following > errors in .hxx file- > > error C2143: syntax error : missing '}' before 'string' > [...] > error C2226: syntax error : unexpected type 'xercesc_3_1::DOMElement' I pretty sure you didn't set VC++ include/library search paths for the XSD runtime (libxsd) and Xerces-C++. Please see the README file that comes with XSD for the detailed instructions. Boris From boris at codesynthesis.com Mon Dec 5 12:34:42 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Dec 5 12:43:40 2011 Subject: [xsd-users] xsd tree - Error while integrating hxx into c++ file. In-Reply-To: References: Message-ID: Hi Sampada, In the future please keep your replies CC'ed to the xsd-users mailing list as discussed in the posting guidelines: http://www.codesynthesis.com/support/posting-guidelines.xhtml Sampada Patil writes: > I have added VC++ include/library search paths for the XSD runtime > (libxsd) and Xerces-C++. as it is mentioned into README file. But > still it gives me the same error messages. > enum value > { > BS, > VI > }; > > BookingInfoGTEnum (value v); > I checked it, it occurs when there is enum value - Does xsd support > enumerations? Yes, XSD supports enums. The problem may be that 'BS' and/or 'VI' are define as macros (there is always this risk with such short, all-capital names). Try to add the following options when compiling your schema and see if it helps: --reserved name BS=BS_value --reserved name VI=VI_value Boris From sampada.patil1 at gmail.com Tue Dec 6 03:36:34 2011 From: sampada.patil1 at gmail.com (Sampada Patil) Date: Tue Dec 6 03:36:43 2011 Subject: [xsd-users] xsd tree - Error while integrating hxx into c++ file. In-Reply-To: References: Message-ID: Hello Boris, I change it manually in .hxx file and its working. But I tried the same by adding this option while compiling - it gives me an error message --reserved-name: error: '--reserved-name': unable to open in read mode. What wrong i am doing here? Thanks and regards, Sampada On Mon, Dec 5, 2011 at 6:34 PM, Boris Kolpackov wrote: > Hi Sampada, > > In the future please keep your replies CC'ed to the xsd-users mailing > list as discussed in the posting guidelines: > > http://www.codesynthesis.com/support/posting-guidelines.xhtml > > Sampada Patil writes: > > > I have added VC++ include/library search paths for the XSD runtime > > (libxsd) and Xerces-C++. as it is mentioned into README file. But > > still it gives me the same error messages. > > enum value > > { > > BS, > > VI > > }; > > > > BookingInfoGTEnum (value v); > > I checked it, it occurs when there is enum value - Does xsd support > > enumerations? > > Yes, XSD supports enums. The problem may be that 'BS' and/or 'VI' > are define as macros (there is always this risk with such short, > all-capital names). Try to add the following options when compiling > your schema and see if it helps: > > --reserved name BS=BS_value > --reserved name VI=VI_value > > Boris > From DLickert at testo.de Tue Dec 6 04:24:48 2011 From: DLickert at testo.de (Lickert, Dominik (LEN, DivHG)) Date: Tue Dec 6 08:52:35 2011 Subject: [xsd-users] AW: Convert a type, created by the xsd-tool, to DOMElement type, defined in xerces Message-ID: <7F3DD1431E490D4DB37C698C3EED6F3014A98D6914@TESTOEX001.cds.testo> Hi Boris, -----Urspr?ngliche Nachricht----- Von: Boris Kolpackov [mailto:boris@codesynthesis.com] Gesendet: Montag, 5. Dezember 2011 17:50 An: Lickert, Dominik (LEN, DivHG) Cc: xsd-users@codesynthesis.com Betreff: Re: Convert a type, created by the xsd-tool, to DOMElement type, defined in xerces Hi Dominik, Lickert, Dominik (LEN, DivHG) writes: > My problem is, that I want to read out the content / NodeValue of an > element, but there is no function in the generated code for that. > > > > > > This type has mixed content. Please refer to the 'mixed' example for more information on how to access its content. Boris Tanks, I get the solution. Now I want also to create a TEXT_NODE and add it to my Text_Type. I compared for this the DOM examples of the Xerces-Parser. But I can't call a create-function, because my DOM-pointer (document tree) hasn't this functions. My DOMNode pointer has also no create-functions. In the example mixed there are only read-methods, but no write-methods. Dominik Testo AG, Lenzkirch, Commercial Register Freiburg 320456 - Board of Directors: Burkart Knospe (CEO), Lothar Walleser, Martin Winkle, Dr. J?rk Hebenstreit- Supervisory board: Anne-Kathrin Deutrich (Chairperson), Klaus Fritzsching, Hartmut Herrlinger, Testo AG, Testo-Strasse 1, 79853 Lenzkirch, Germany From boris at codesynthesis.com Tue Dec 6 08:45:54 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Dec 6 08:55:02 2011 Subject: [xsd-users] xsd tree - Error while integrating hxx into c++ file. In-Reply-To: References: Message-ID: Hi Sampada, Sampada Patil writes: > But I tried the same by adding this option while compiling - it gives me an > error message --reserved-name: error: '--reserved-name': unable to open in > read mode. Make sure that you place the --reserved-name options before the schema file. In other words, instead of: xsd cxx-tree file.xsd --reserved-name BS=BS_value Write: xsd cxx-tree --reserved-name BS=BS_value file.xsd Boris From boris at codesynthesis.com Tue Dec 6 08:48:28 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Dec 6 08:57:39 2011 Subject: [xsd-users] Re: Convert a type, created by the xsd-tool, to DOMElement type, defined in xerces In-Reply-To: <7F3DD1431E490D4DB37C698C3EED6F3014A98D6914@TESTOEX001.cds.testo> References: <7F3DD1431E490D4DB37C698C3EED6F3014A98D6914@TESTOEX001.cds.testo> Message-ID: Hi Dominik, Lickert, Dominik (LEN, DivHG) writes: > Now I want also to create a TEXT_NODE and add it to my Text_Type. > > [...] > > In the example mixed there are only read-methods, but no write-methods. The DOM association feature that is used in the 'mixed' example only works for parsing. If you also need to create XML documents with mixed content, then you will need to use type customization. See the 'custom/mixed' example for details. Boris From sampada.patil1 at gmail.com Wed Dec 7 09:49:49 2011 From: sampada.patil1 at gmail.com (Sampada Patil) Date: Wed Dec 7 09:49:57 2011 Subject: [xsd-users] xsd tree - Error while integrating hxx into c++ file. In-Reply-To: References: Message-ID: Hallo Boris, I used --show-sloc option to check lines of code. and it shows me ~30000. But my schema document is not so big. I am using only --generate-serialization and --generate-ostream options. Why it is still too big number? Can I still use this databinding compiler without any problem? Thanks for your help. Reagrds, Sampada From sampada.patil1 at gmail.com Wed Dec 7 12:24:46 2011 From: sampada.patil1 at gmail.com (Sampada Patil) Date: Wed Dec 7 12:24:54 2011 Subject: [xsd-users] Question related to --show-sloc option! Message-ID: Hello All, Here is the same mail again, edited now the subject line :) I used --show-sloc option to check lines of code and it shows me ~ 30000. But my schema file is not so big (It is aroung 5000 lines) and while compiling i am using only --generate-serialization and --generate-ostream options. Why does it gives me so big number? Can I still use xsd data binding compiler without any problem? Thanks in advance. Regards, Sampada From boris at codesynthesis.com Wed Dec 7 12:49:10 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Dec 7 12:58:41 2011 Subject: [xsd-users] Question related to --show-sloc option! In-Reply-To: References: Message-ID: Hi Sampada, Sampada Patil writes: > Here is the same mail again, edited now the subject line :) Please don't re-send the same question multiple times if you don't get a reply. This mailing list is a best-effort support channel and we answer questions if/when we have time. If you require more predictable support, consider purchasing a commercial support contract. > I used --show-sloc option to check lines of code and it shows me ~ 30000. > But my schema file is not so big (It is aroung 5000 lines) and while > compiling i am using only --generate-serialization and --generate-ostream > options. > > Why does it gives me so big number? 30,000 lines of C++ code for a 5,000 lines schema sounds about right, especially considering that you use a couple of "--generate-xxx" options. One way to reduce the generated code size is to specify the document root with the --root-element option if your schema defines multiple global elements and not all of them are valid document roots. > Can I still use xsd data binding compiler without any problem? I am not sure what "problems" you refer to. With 30,000 lines of generated code you can use XSD under the GPL or a commercial proprietary license. This amount exceeds the free proprietary license limit so this license is unfortunately not available to you. See these pages for more information: http://www.codesynthesis.com/products/xsd/license.xhtml http://www.codesynthesis.com/products/xsd/free-license.xhtml Boris From bhartsb at gmail.com Wed Dec 7 13:05:14 2011 From: bhartsb at gmail.com (B Hart) Date: Wed Dec 7 13:05:21 2011 Subject: [xsd-users] similar schemas and name spaces Message-ID: I have two sets of schema files that have some elements and types in common, but other elements and types that are not the same. I want to be able to use the XSD generated .cxx and .hxx in the same main() program but I'm getting linkage type errors. I've tried to make one pair of the .cxx and .hxx be in a separate C++ namespace but I'm getting errors. Any advice on the correct approach to use is appreciated. From boris at codesynthesis.com Wed Dec 7 13:00:17 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Dec 7 13:09:43 2011 Subject: [xsd-users] similar schemas and name spaces In-Reply-To: References: Message-ID: Hi, B Hart writes: > I have two sets of schema files that have some elements and types in > common, but other elements and types that are not the same. I want to be > able to use the XSD generated .cxx and .hxx in the same main() program but > I'm getting linkage type errors. I've tried to make one pair of the .cxx > and .hxx be in a separate C++ namespace but I'm getting errors. Any advice > on the correct approach to use is appreciated. The correct approach is to place the schemas into different C++ namespaces using the --namespace-map option. If your schemas do not have an XML namespace (i.e., no tragetNamespace attribute), then use this syntax: --namespace-map =my_namespace Boris From boris at codesynthesis.com Thu Dec 8 08:16:27 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Dec 8 08:26:05 2011 Subject: [xsd-users] similar schemas and name spaces In-Reply-To: References: Message-ID: Hi, In the future please keep your replies CC'ed to the xsd-users mailing list as discussed in the posting guidelines: http://www.codesynthesis.com/support/posting-guidelines.xhtml B Hart writes: > Boris Kolpackov writes: > > > The correct approach is to place the schemas into different C++ namespaces > > using the --namespace-map option. If your schemas do not have an XML > > namespace (i.e., no tragetNamespace attribute), then use this syntax: > > > > --namespace-map =my_namespace > > And if they do have a target namespace specified??? Then you specify the XML namespace before the equal sign: --namespace-map http://www.example.com/my-xml-namespace=my_namespace BTW, all this is documented in the XSD compiler command line manual (man pages): http://www.codesynthesis.com/projects/xsd/documentation/xsd.xhtml Boris From vishkale at gmail.com Wed Dec 7 16:17:37 2011 From: vishkale at gmail.com (Vishwanath Kale) Date: Thu Dec 8 08:26:19 2011 Subject: [xsd-users] Program Crash with message : basic_string::_S_construct null not valid In-Reply-To: References: Message-ID: Boris, Thank you for your Response. Yes, I agree XSD version is very old. I would like to keep it that way, till the time i get the open source (SRC SRGS code) program up and running. I am attaching the full src code with main.cpp. 1. srgs_parser - main.cpp 2. libsrgs\srgs - sub_main.cpp sub_main entry point. 3. libsrgs\srgs - grammar.cxx function: make_grammar <-- Issue is in this function I have located a line which is causing the basic_string::_S_construct null not valid. When the function below is called grammar_p.parsers(rule_p, lexicon_p, meta_p, string_p, tag_p, Tag_format_datatype_p, Version_datatype_p, lang_p, string_p, // base Root_datatype_p, Mode_datatype_p); Which is implemented in srgs-parser-templates.ixx template < typename _xsd_rule_, typename _xsd_lexicon_, typename _xsd_meta_, typename _xsd_metadata_, typename _xsd_tag_, typename _xsd_tag_format_, typename _xsd_version_, typename _xsd_lang_, typename _xsd_base_, typename _xsd_root_, typename _xsd_mode_ > inline void grammar< _xsd_rule_, _xsd_lexicon_, _xsd_meta_, _xsd_metadata_, _xsd_tag_, _xsd_tag_format_, _xsd_version_, _xsd_lang_, _xsd_base_, _xsd_root_, _xsd_mode_ >:: parsers (::xsd::cxx::parser::parser< _xsd_rule_, char >& rule, ::xsd::cxx::parser::parser< _xsd_lexicon_, char >& lexicon, ::xsd::cxx::parser::parser< _xsd_meta_, char >& meta, ::xsd::cxx::parser::parser< _xsd_metadata_, char >& metadata, ::xsd::cxx::parser::parser< _xsd_tag_, char >& tag, ::xsd::cxx::parser::parser< _xsd_tag_format_, char >& tag_format, ::xsd::cxx::parser::parser< _xsd_version_, char >& version, ::xsd::cxx::parser::parser< _xsd_lang_, char >& lang, ::xsd::cxx::parser::parser< _xsd_base_, char >& base, ::xsd::cxx::parser::parser< _xsd_root_, char >& root, ::xsd::cxx::parser::parser< _xsd_mode_, char >& mode) { // this->_xsd_rule__ = &rule; this->_xsd_lexicon__ = &lexicon; this->_xsd_meta__ = &meta; this->_xsd_metadata__ = &metadata; this->_xsd_tag__ = &tag; this->_xsd_tag_format__ = &tag_format; this->_xsd_version__ = &version; this->_xsd_lang__ = ⟨ this->_xsd_base__ = &base; this->_xsd_root__ = &root; this->_xsd_mode__ = &mode; } If i comment out this line this->_xsd_rule__ = &rule; and keep rest as is. basic_string::_S_construct null not valid error is not thrown. The exception goes away though by commenting this line the the SRGS parsing is not complete, as i don't have srgs rule element parsed. Any idea? Is it something to do with rule tag in srgs.xsd? The rule tage element NULL etc? Thank you for all your help * * *On Tue, Dec 6, 2011 at 5:13 PM, Vishwanath Kale wrote: * > Boris, Thank you for your Response. > > Yes, I agree XSD version is very old. I would like to keep it that way, > till the time i get the open source (SRC SRGS code) program up and running. > > I am attaching the full src code with main.cpp. > > 1. srgs_parser - main.cpp > 2. libsrgs\srgs - sub_main.cpp sub_main entry point. > 3. libsrgs\srgs - grammar.cxx function: make_grammar <-- Issue is in this > function > > I have located a line which is causing the basic_string::_S_construct > null not valid. > > When the function below is called > > grammar_p.parsers(rule_p, > lexicon_p, > meta_p, > string_p, > tag_p, > Tag_format_datatype_p, > Version_datatype_p, > lang_p, > string_p, // base > Root_datatype_p, > Mode_datatype_p); > > Which is implemented in srgs-parser-templates.ixx > > template < typename _xsd_rule_, typename _xsd_lexicon_, typename > _xsd_meta_, typename _xsd_metadata_, typename _xsd_tag_, typename > _xsd_tag_format_, typename _xsd_version_, typename _xsd_lang_, typename > _xsd_base_, typename _xsd_root_, typename _xsd_mode_ > > inline > void grammar< _xsd_rule_, _xsd_lexicon_, _xsd_meta_, > _xsd_metadata_, _xsd_tag_, _xsd_tag_format_, _xsd_version_, _xsd_lang_, > _xsd_base_, _xsd_root_, _xsd_mode_ >:: > parsers (::xsd::cxx::parser::parser< _xsd_rule_, char >& rule, > ::xsd::cxx::parser::parser< _xsd_lexicon_, char >& > lexicon, > ::xsd::cxx::parser::parser< _xsd_meta_, char >& meta, > ::xsd::cxx::parser::parser< _xsd_metadata_, char >& > metadata, > ::xsd::cxx::parser::parser< _xsd_tag_, char >& tag, > ::xsd::cxx::parser::parser< _xsd_tag_format_, char >& > tag_format, > ::xsd::cxx::parser::parser< _xsd_version_, char >& > version, > ::xsd::cxx::parser::parser< _xsd_lang_, char >& lang, > ::xsd::cxx::parser::parser< _xsd_base_, char >& base, > ::xsd::cxx::parser::parser< _xsd_root_, char >& root, > ::xsd::cxx::parser::parser< _xsd_mode_, char >& mode) > { > // this->_xsd_rule__ = &rule; > this->_xsd_lexicon__ = &lexicon; > this->_xsd_meta__ = &meta; > this->_xsd_metadata__ = &metadata; > this->_xsd_tag__ = &tag; > this->_xsd_tag_format__ = &tag_format; > this->_xsd_version__ = &version; > this->_xsd_lang__ = ⟨ > this->_xsd_base__ = &base; > this->_xsd_root__ = &root; > this->_xsd_mode__ = &mode; > } > > If i comment out this line this->_xsd_rule__ = &rule; and keep rest as > is. basic_string::_S_construct null not valid error is not thrown. The > exception goes away though by commenting this line the the SRGS parsing is > not complete, as i don't have srgs rule element parsed. > > Any idea? Is it something to do with rule tag in srgs.xsd? The rule tage > element NULL etc? > > Thank you for all your help > > > On Sun, Dec 4, 2011 at 4:58 AM, Boris Kolpackov wrote: > >> Hi Vishwanath, >> >> Vishwanath Kale writes: >> >> >> > xsd : xsd-2.3.0-i686-windows >> >> This is a very, very old version of XSD. You may want to consider >> upgrading, though the C++/Parser mapping in XSD 3-series is quite >> different compared to XSD 2.3.0. So you may have to make quite a >> few changes to your code. >> >> >> > The full src file with few other files is attached to email as well. >> >> I couldn't try your code sine it doesn't include the test driver (i.e., >> the source file with main()). If you want me to investigate this >> further, then you will need to send me (off list) a complete test. >> >> Boris >> > > -------------- next part -------------- A non-text attachment was scrubbed... Name: srgs_parser-20061217.zip Type: application/zip Size: 93057 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20111207/e69401eb/srgs_parser-20061217-0001.zip From boris at codesynthesis.com Thu Dec 8 08:38:10 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Dec 8 08:47:50 2011 Subject: [xsd-users] Program Crash with message : basic_string::_S_construct null not valid In-Reply-To: References: Message-ID: Hi Vishwanath, Vishwanath Kale writes: > I am attaching the full src code with main.cpp. I was unable to build your code -- there are still some files missing. Unfortunately, I don't have time to try to figure out how to build your project. If you want me to help you find the problem, send a small, complete, buildable test that reproduces it. That is, one schema file, one XML file, and one .cpp files with main(). Not a source code dump with a hundred files spread out over multiple libraries. Boris From bhartsb at gmail.com Thu Dec 8 13:28:47 2011 From: bhartsb at gmail.com (B Hart) Date: Thu Dec 8 13:28:55 2011 Subject: [xsd-users] similar schemas and name spaces In-Reply-To: References: Message-ID: Okay, thanks. I will try to remember to reply all. On Thu, Dec 8, 2011 at 5:16 AM, Boris Kolpackov wrote: > Hi, > > In the future please keep your replies CC'ed to the xsd-users mailing > list as discussed in the posting guidelines: > > http://www.codesynthesis.com/support/posting-guidelines.xhtml > > B Hart writes: > > > Boris Kolpackov writes: > > > > > The correct approach is to place the schemas into different C++ > namespaces > > > using the --namespace-map option. If your schemas do not have an XML > > > namespace (i.e., no tragetNamespace attribute), then use this syntax: > > > > > > --namespace-map =my_namespace > > > > And if they do have a target namespace specified??? > > Then you specify the XML namespace before the equal sign: > > --namespace-map http://www.example.com/my-xml-namespace=my_namespace > > BTW, all this is documented in the XSD compiler command line manual > (man pages): > > http://www.codesynthesis.com/projects/xsd/documentation/xsd.xhtml > > Boris > From bhartsb at gmail.com Thu Dec 8 19:59:53 2011 From: bhartsb at gmail.com (B Hart) Date: Thu Dec 8 20:00:02 2011 Subject: [xsd-users] nillable="true" Message-ID: Does XSD support element attribute nillable="true"? Thanks. From boris at codesynthesis.com Fri Dec 9 07:39:38 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Dec 9 07:49:29 2011 Subject: [xsd-users] nillable="true" In-Reply-To: References: Message-ID: B Hart writes: > Does XSD support element attribute nillable="true"? No, XSD does not support nillable. For some possible work-arounds, see this thread: http://www.codesynthesis.com/pipermail/xsd-users/2011-January/003134.html Boris From preethi.ramalingam at credit-suisse.com Thu Dec 8 21:13:06 2011 From: preethi.ramalingam at credit-suisse.com (Ramalingam, Preethi) Date: Fri Dec 9 07:50:11 2011 Subject: [xsd-users] 'elf_begin' make error Message-ID: <28843FEAA4698446AA9292AB906DC149290809@ESNG17P32004B.csfb.cs-group.com> Hi Boris, I get the following error when I try to make the hello world parser example. /share/mercury/dev/pramali4/xsd-3.3.0-sparc-solaris/examples/cxx/parser/ hello $ make g++ -W -Wall -O3 /share/mercury/dev/pramali4/xerces-c-3.1.1-sparc-solaris-cc-5.10/lib -o driver driver.o hello-pskel.o -lxerces-c -lxerces-c ld: elf error: file /share/mercury/dev/pramali4/xerces-c-3.1.1-sparc-solaris-cc-5.10/lib: elf_begin: I/O error: region read: Is a directory ld: fatal: File processing errors. No output written to driver collect2: ld returned 1 exit status make: *** [driver] Error 1 Compiler : /share/mercury/SunStudio12/12/SUNWspro/prod/bin/CC OS : SunOS 5.10 Generic_141444-09 sun4u sparc SUNW,Netra-T12 Could you please help me with this? Many thanks, Preethi =============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html =============================================================================== From preethi.ramalingam at credit-suisse.com Thu Dec 8 21:20:03 2011 From: preethi.ramalingam at credit-suisse.com (Ramalingam, Preethi) Date: Fri Dec 9 07:50:11 2011 Subject: [xsd-users] Undefined Symbol error while trying to 'make' In-Reply-To: <28843FEAA4698446AA9292AB906DC149290809@ESNG17P32004B.csfb.cs-group.com> References: <28843FEAA4698446AA9292AB906DC149290809@ESNG17P32004B.csfb.cs-group.com> Message-ID: <28843FEAA4698446AA9292AB906DC14929080A@ESNG17P32004B.csfb.cs-group.com> [+Changed Subject] Hi Boris, I managed to figure that out. I had to append the env variable LDFLAGS with a '-L'. It went on to give me the following errors: /share/mercury/dev/pramali4/xsd-3.3.0-sparc-solaris/examples/cxx/parser/ hello $ make g++ -I/share/mercury/dev/pramali4/xerces-c-3.1.1-sparc-solaris-cc-5.10/inclu de -I../../../../libxsd -W -Wall -O3 -c driver.cxx -o driver.o g++ -I/share/mercury/dev/pramali4/xerces-c-3.1.1-sparc-solaris-cc-5.10/inclu de -I../../../../libxsd -W -Wall -O3 -c hello-pskel.cxx -o hello-pskel.o g++ -W -Wall -O3 -L/share/mercury/dev/pramali4/xerces-c-3.1.1-sparc-solaris-cc-5.10/lib -o driver driver.o hello-pskel.o -lxerces-c -lxerces-c Undefined first referenced symbol in file xercesc_3_1::XMLAttDefList::serialize(xercesc_3_1::XSerializeEngine&)dri ver.o xercesc_3_1::XMLUni::fgXercesValidationErrorAsFatal driver.o xercesc_3_1::XMLAttDefList::getProtoType() const driver.o xercesc_3_1::SAXParseException::getLineNumber() const driver.o xercesc_3_1::SAXParseException::getSystemId() const driver.o typeinfo for xercesc_3_1::SAXParseExceptiondriver.o xercesc_3_1::XMemory::operator delete(void*)driver.o xercesc_3_1::SAXParseException::~SAXParseException()driver.o xercesc_3_1::XMLUni::fgXercesHandleMultipleImports driver.o xercesc_3_1::SAXParseException::SAXParseException(xercesc_3_1::SAXParseE xception const&)driver.o xercesc_3_1::XMLUni::fgSAX2CoreNameSpacePrefixes driver.o xercesc_3_1::SAXParseException::getColumnNumber() const driver.o xercesc_3_1::XMLPlatformUtils::Initialize(char const*, char const*, xercesc_3_1::PanicHandler*, xercesc_3_1::MemoryManager*)driver.o xercesc_3_1::XMLUni::fgXercesSchemaFullChecking driver.o xercesc_3_1::XMLReaderFactory::createXMLReader(xercesc_3_1::MemoryManage r*, xercesc_3_1::XMLGrammarPool*)driver.o xercesc_3_1::SAXParseException::getPublicId() const driver.o xercesc_3_1::SchemaSymbols::fgURI_XSI driver.o xercesc_3_1::XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation driver.o xercesc_3_1::XMLUni::fgXercescDefaultLocale driver.o xercesc_3_1::SAXParseException::SAXParseException(unsigned short const*, unsigned short const*, unsigned short const*, unsigned long long, unsigned long long, xercesc_3_1::MemoryManager*)driver.o xercesc_3_1::XMLUni::fgXercesSchemaExternalSchemaLocation driver.o xercesc_3_1::XMLUni::fgSAX2CoreValidation driver.o xercesc_3_1::XMLUni::fgSAX2CoreNameSpaces driver.o xercesc_3_1::SchemaSymbols::fgXSI_TYPE driver.o xercesc_3_1::XMLPlatformUtils::fgMemoryManager driver.o xercesc_3_1::XMLPlatformUtils::Terminate() driver.o xercesc_3_1::XMLAttDefList::isSerializable() const driver.o xercesc_3_1::XMLUni::fgXercesSchema driver.o ld: fatal: Symbol referencing errors. No output written to driver collect2: ld returned 1 exit status make: *** [driver] Error 1 Please help me with this. Thanks, Preethi > _____________________________________________ > From: Ramalingam, Preethi > Sent: Friday, December 09, 2011 10:13 AM > To: 'xsd-users@codesynthesis.com' > Subject: [xsd-users] 'elf_begin' make error > > Hi Boris, > > I get the following error when I try to make the hello world parser > example. > > /share/mercury/dev/pramali4/xsd-3.3.0-sparc-solaris/examples/cxx/parse > r/hello $ make > g++ -W -Wall -O3 > /share/mercury/dev/pramali4/xerces-c-3.1.1-sparc-solaris-cc-5.10/lib > -o driver driver.o hello-pskel.o -lxerces-c -lxerces-c > ld: elf error: file > /share/mercury/dev/pramali4/xerces-c-3.1.1-sparc-solaris-cc-5.10/lib: > elf_begin: I/O error: region read: Is a directory > ld: fatal: File processing errors. No output written to driver > collect2: ld returned 1 exit status > make: *** [driver] Error 1 > > Compiler : /share/mercury/SunStudio12/12/SUNWspro/prod/bin/CC > > OS : SunOS 5.10 Generic_141444-09 sun4u sparc SUNW,Netra-T12 > > Could you please help me with this? > > Many thanks, > Preethi > =============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html =============================================================================== From boris at codesynthesis.com Fri Dec 9 07:49:40 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Dec 9 07:59:32 2011 Subject: [xsd-users] Undefined Symbol error while trying to 'make' In-Reply-To: <28843FEAA4698446AA9292AB906DC14929080A@ESNG17P32004B.csfb.cs-group.com> References: <28843FEAA4698446AA9292AB906DC149290809@ESNG17P32004B.csfb.cs-group.com> <28843FEAA4698446AA9292AB906DC14929080A@ESNG17P32004B.csfb.cs-group.com> Message-ID: Hi Preethi, Ramalingam, Preethi writes: > /share/mercury/dev/pramali4/xsd-3.3.0-sparc-solaris/examples/cxx/parser/ > hello $ make > g++ [...] > > Undefined first referenced > symbol in file > xercesc_3_1::XMLAttDefList::serialize(xercesc_3_1::XSerializeEngine&) driver.o The problem is that you use g++ to compile the example but the Xerces-C++ library was built with Sun CC. If you want to use Sun CC (as you indicated in your previous email), then you should do this: $ make clean $ make CXX=/share/mercury/SunStudio12/12/SUNWspro/prod/bin/CC Alternatively, if you want to use g++, then you will need to build Xerces-C++ with this compiler. The Xerces-C++ project page has the instructions: http://xerces.apache.org/xerces-c/build-3.html Boris From bhartsb at gmail.com Fri Dec 9 14:03:08 2011 From: bhartsb at gmail.com (B Hart) Date: Fri Dec 9 14:03:15 2011 Subject: [xsd-users] declaring a nested sequence iterator Message-ID: I'm having trouble with the syntax while declaring/defining a sequence iterator that is nested inside two outer sequences. Header | |_Record | |_E11_03_iterator The outermost sequence iterator is declared like: EMSDataSet::Header_iterator i The 1st inner sequence iterator (For a Record) is declared like: Header::Record_iterator i1 E11_03_sequence is inside a record and I can't seem to declare a E11_03_iterator. Thanks in advance. From bhartsb at gmail.com Fri Dec 9 14:08:32 2011 From: bhartsb at gmail.com (B Hart) Date: Fri Dec 9 14:08:40 2011 Subject: [xsd-users] Re: declaring a nested sequence iterator In-Reply-To: References: Message-ID: Never mind, since E11_03 _iterator is a member of E11, I needed to do this: E11::E11_03_iterator itemp; On Fri, Dec 9, 2011 at 11:03 AM, B Hart wrote: > I'm having trouble with the syntax while declaring/defining a sequence > iterator that is nested inside two outer sequences. > Header > | > |_Record > | > |_E11_03_iterator > > The outermost sequence iterator is declared like: > EMSDataSet::Header_iterator i > The 1st inner sequence iterator (For a Record) is declared like: > Header::Record_iterator i1 > > E11_03_sequence is inside a record and I can't seem to declare a > E11_03_iterator. > > Thanks in advance. > From rlischner at proteuseng.com Wed Dec 14 08:06:27 2011 From: rlischner at proteuseng.com (Ray Lischner) Date: Wed Dec 14 08:56:31 2011 Subject: [xsd-users] Problem with ostream output of anonymous types and substitution groups Message-ID: There seems to be a problem with ostream output of anonymous polymorphic types, using substitution groups. This is illustrated by copying the tests/cxx/tree/polymorphism/ostream example and changing the schema to: Change the test.xml file to: Add --root-element root to the xsd_options in the makefile. When I run the driver, I get a type_info exception: no type information available for type '' Also, the name "base" is printed instead of "der1" or "der2". Ray Lischner, Distinguished Member of Technical Staff 133 National Business Pkwy, Ste 150 t. 443.539.3448 Annapolis Junction, MD 20701 c. 410.854.5170 rlischner@proteuseng.com f. 443.539.3370 From boris at codesynthesis.com Thu Dec 15 06:21:06 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Dec 15 06:19:38 2011 Subject: [xsd-users] Problem with ostream output of anonymous types and substitution groups In-Reply-To: References: Message-ID: Hi Ray, Ray Lischner writes: > There seems to be a problem with ostream output of anonymous polymorphic > types, using substitution groups. > > [...] > > When I run the driver, I get a type_info exception: > > no type information available for type '' Yes, this is a bug. XSD is too aggressive in trying to minimize the number of types treated as polymorphic. I have fixed it and the patch is available here: http://scm.codesynthesis.com/?p=xsd/xsd.git;a=commit;h=4c408a85759eb42b6b84b8cdab81453df31cd289 Let me know if you need a pre-release binary. > Also, the name "base" is printed instead of "der1" or "der2". I agree it would be nice if XSD printed the substituted element names. However, this will complicate things quite a bit plus XSD will only be able to print some substituted name, not necessarily the one that was used in the XML document, in case there is more than one element with the same type. So at the moment I tend to prefer to leave it as is (i.e., XSD prints static element names). Thanks for reporting this! Boris From Vaughan at roberts.name Sun Dec 18 23:28:11 2011 From: Vaughan at roberts.name (Vaughan Roberts) Date: Sun Dec 18 23:28:23 2011 Subject: [xsd-users] Problem running cxx-parser on Mac in Xcode 4.2 using xerces-c (v 3.1.1) Message-ID: <00d001ccbe06$9f938c30$debaa490$@Roberts.name> Hi, I have developed and run an application using cxx-parser on a Windows box under Cygwin and it all works well. I now want to run the same code on a Mac using Xcode as the development environment. I had to compile the xerces-c library (v 3.1.1) using g++ in Xcode (because I also wanted to run it on the arm7 architecture as well). I am now getting a runtime exception (termination) in what looks like the cxx-parser code, though it may be located elsewhere. The file I am trying to parse works on the Windows box, so the problem is probably not due to that. This is what gdb is giving me shortly before the application terminates: (gdb) bt #0 xsd::cxx::xml::auto_initializer::~auto_initializer (this=0xbfffd9f8) at elements.hxx:100 #1 0x00052c0e in xsd::cxx::parser::xerces::document::parse (this=, uri=, f={x_ = 0, static dont_validate = 1, static dont_initialize = 2, static no_multiple_imports = 4}, p=@0xbfffd9f8) at elements.txx:99 #2 0x0000badf in xsd::cxx::parser::xerces::document::parse (this=0xbfffdc18, uri=0x7a7b0e0 "/Users/vaughan/Library/Application Support/iPhone Simulator/5.0/Applications/94F9BDE9-70AB-40BA-84BA-76B0BE94C8DF/Documents/Ke w_v_Balwyn_16 Dec 2011.xml", f={x_ = 0, static dont_validate = 1, static dont_initialize = 2, static no_multiple_imports = 4}, p=@0xbfffdbf0) at elements.txx:110 I hope someone can recognise the cause of why this is terminating and help me short-cut the diagnostic stage J. Best regards, Vaughan Mob: 0412 122 362 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5360 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20111219/1f77c083/smime.bin From rlischner at proteuseng.com Mon Dec 19 09:55:41 2011 From: rlischner at proteuseng.com (Ray Lischner) Date: Tue Dec 20 03:42:02 2011 Subject: [xsd-users] Problem with ostream output of anonymous types and substitution groups In-Reply-To: References: , Message-ID: > Yes, this is a bug. XSD is too aggressive in trying to minimize the > number of types treated as polymorphic. I have fixed it and the > patch is available here: > http://scm.codesynthesis.com/?p=xsd/xsd.git;a=commit;h=4c408a85759eb42b6b84b8cdab81453df31cd289 Thank you. The patch 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.5170 rlischner@proteuseng.com f. 443.539.3370 From boris at codesynthesis.com Tue Dec 20 03:56:34 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Dec 20 03:54:30 2011 Subject: [xsd-users] Problem running cxx-parser on Mac in Xcode 4.2 using xerces-c (v 3.1.1) In-Reply-To: <00d001ccbe06$9f938c30$debaa490$@Roberts.name> References: <00d001ccbe06$9f938c30$debaa490$@Roberts.name> Message-ID: Hi Vaughan, Vaughan Roberts writes: > I had to compile the xerces-c library (v 3.1.1) using g++ in Xcode > (because I also wanted to run it on the arm7 architecture as well). Note that we haven't tested Xerces-C++/XSD on iPhone (either hardware or simulator). Generally, we recommend that people use XSD/e[1] on this platform. > I am now getting a runtime exception (termination) in what looks like the > cxx-parser code, though it may be located elsewhere. The file I am trying > to parse works on the Windows box, so the problem is probably not due to > that. If the same code works on other platforms, then this is most likely a platform-specific issue. > This is what gdb is giving me shortly before the application terminates: > > #0 xsd::cxx::xml::auto_initializer::~auto_initializer (this=0xbfffd9f8) at > elements.hxx:100 The auto_initializer destructor terminates the Xerces-C++ runtime. What you may want to try is initialize Xerces-C++ yourself (see, the 'performance' example) and then pass the dont_initialize flag to the document's parse() function. [1] http://www.codesynthesis.com/products/xsde/ Boris From Vaughan at roberts.name Tue Dec 20 04:55:49 2011 From: Vaughan at roberts.name (Vaughan Roberts) Date: Tue Dec 20 04:56:02 2011 Subject: [xsd-users] Problem running cxx-parser on Mac in Xcode 4.2 using xerces-c (v 3.1.1) In-Reply-To: References: <00d001ccbe06$9f938c30$debaa490$@Roberts.name> Message-ID: <008c01ccbefd$8f036730$ad0a3590$@Roberts.name> Thanks Boris I will give initialising xerces-c a try. Looking over the XSD/e documentation I gather that it provides its own runtime library rather than relying on xerces-c (or Expat), is this correct? In order to use it on the arm7 architecture I will need to compile the runtime library for that platform, though I can use your binary for the simulator. Given the time I have spent on development using cxx-parser, is the parser implementation similar enough between that and XSD/e to port it across with minimal effort? Best regards, Vaughan Mob: 0412 122 362 -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Tuesday, 20 December 2011 19:57 To: Vaughan Roberts Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] Problem running cxx-parser on Mac in Xcode 4.2 using xerces-c (v 3.1.1) Hi Vaughan, Vaughan Roberts writes: > I had to compile the xerces-c library (v 3.1.1) using g++ in Xcode > (because I also wanted to run it on the arm7 architecture as well). Note that we haven't tested Xerces-C++/XSD on iPhone (either hardware or simulator). Generally, we recommend that people use XSD/e[1] on this platform. > I am now getting a runtime exception (termination) in what looks like > the cxx-parser code, though it may be located elsewhere. The file I am > trying to parse works on the Windows box, so the problem is probably > not due to that. If the same code works on other platforms, then this is most likely a platform-specific issue. > This is what gdb is giving me shortly before the application terminates: > > #0 xsd::cxx::xml::auto_initializer::~auto_initializer > (this=0xbfffd9f8) at > elements.hxx:100 The auto_initializer destructor terminates the Xerces-C++ runtime. What you may want to try is initialize Xerces-C++ yourself (see, the 'performance' example) and then pass the dont_initialize flag to the document's parse() function. [1] http://www.codesynthesis.com/products/xsde/ Boris -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5360 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20111220/b08754e9/smime.bin From boris at codesynthesis.com Wed Dec 21 07:51:42 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Dec 21 07:49:30 2011 Subject: [xsd-users] Problem running cxx-parser on Mac in Xcode 4.2 using xerces-c (v 3.1.1) In-Reply-To: <008c01ccbefd$8f036730$ad0a3590$@Roberts.name> References: <00d001ccbe06$9f938c30$debaa490$@Roberts.name> <008c01ccbefd$8f036730$ad0a3590$@Roberts.name> Message-ID: Hi Vaughan, Vaughan Roberts writes: > Looking over the XSD/e documentation I gather that it provides its own > runtime library rather than relying on xerces-c (or Expat), is this > correct? Yes, it only depends on its own runtime (libxsde). There are no external dependencies. > In order to use it on the arm7 architecture I will need to compile the > runtime library for that platform, though I can use your binary for the > simulator. Actually, the XSD/e package for Mac OS X comes with pre-built XSD/e compiler as well as source code for the runtime. So you will need to build the runtime for both the hardware and the simulator. Look into the etc/ directory in the package, it contains sample config files and build instructions for various platforms, include iOS. > Given the time I have spent on development using cxx-parser, is the parser > implementation similar enough between that and XSD/e to port it across with > minimal effort? Yes, the C++/Parser mapping in XSD/e is very similar to C++/Parser in XSD, especially if you configure XSD/e with STL and C++ exceptions enabled. Boris From bhartsb at gmail.com Thu Dec 29 02:53:44 2011 From: bhartsb at gmail.com (B Hart) Date: Thu Dec 29 02:53:53 2011 Subject: [xsd-users] nillable="true" In-Reply-To: References: Message-ID: Hi Boris, As per nillable and my own XSDs using minoccurs=0 is fine. However, there are XSDs that I have to conform to (when serializing) that use nillable. For example: The ifc.zip example project you pointed me to is specific to another XSD user's project. I don't understand what exactly you are doing with in the .options files, so can you please provide additional instructions on how to properly use nillable-type.hxx? The XSDs that I must conform with are found here: http://www.nemsis.org/v2/downloads/emsDataset.html Thanks. Brian On Fri, Dec 9, 2011 at 4:39 AM, Boris Kolpackov wrote: > B Hart writes: > > > Does XSD support element attribute nillable="true"? > > No, XSD does not support nillable. For some possible work-arounds, > see this thread: > > http://www.codesynthesis.com/pipermail/xsd-users/2011-January/003134.html > > Boris > From boris at codesynthesis.com Thu Dec 29 09:17:25 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Dec 29 09:18:10 2011 Subject: [xsd-users] nillable="true" In-Reply-To: References: Message-ID: Hi Brian, B Hart writes: > The ifc.zip example project you pointed me to is specific to another XSD > user's project. I don't understand what exactly you are doing with in the > .options files, so can you please provide additional instructions on how to > properly use nillable-type.hxx? > > The XSDs that I must conform with are found here: > http://www.nemsis.org/v2/downloads/emsDataset.html Unfortunately we don't have the resources to provide detail instructions for each specific schema. The mailing list thread I mentioned in my previous reply shows how to do this for some schema and the same idea can be equally applied to other schemas. In short, the approach uses the type customization mechanism in C++/Tree[1] to wrap each type that is used in a nillable element with a C++ class template that provides the nillable semantics. Also if you have a specific question about any part of the implementation, please feel free to ask. [1] http://wiki.codesynthesis.com/Tree/Customization_guide Boris From bhartsb at gmail.com Fri Dec 30 02:35:53 2011 From: bhartsb at gmail.com (B Hart) Date: Fri Dec 30 02:36:01 2011 Subject: [xsd-users] nillable="true" In-Reply-To: References: Message-ID: Hi Boris, I'm having trouble making sense of what's in ifc.zip. Files are not commented and there are missing xsd files. I understand that the readme file contains three XSD command line statements, and I now understand that files with the .options extensions are XSD options and not related to MSVC. The readme's first XSD command line statement: xsd cxx-tree --options-file common.options --generate-xml-schema xml-schema.xsd This generates has definitions for all the schema built-in types into a separate .hxx. I noted that the file I originally generated from my NEMSIS EMSDataSet.xsd had the includes for all .hxx files related to schema built-in types, and all the type defines for the C++ namespace "xml_schema". When I regenerate EMSDataSet.hxx and EMSDataSet.cxx I see that the xml-schema includes and typedefs are no longer embedded, rather included indirectly via nillable-type.hxx. So I'm assuming that you generated xml_schema stuff in a separate file just for good organization? I now understand that ifc.options should contain just the XSD command line parameters the I would normally use for generating .hxx and .cxx from my NEMSIS schema. Since I don't use --generate-polymorphic or --generate-default-ctor I'm not sure whether in my case they're needed or not? Per the command line statements: xsd cxx-tree --options-file common.options --options-file ifc.options ex.xsd xsd cxx-tree --options-file common.options --options-file ifc.options --options-file ifc-custom.options --parts 10 IFC2X3.xsd ex.xsd and IFC2X3.xsd are the missing files I mentioned. I'm assuming that one of these would correspond to my EMSDataSet.xsd, but I'm not sure which one, or why there are two steps here instead of one??? So anyway, per my modified versions of two of the files in ifc.zip (I understand I didn't have to keep the same file names, but kept them the same while I'm trying to make sense of this): ifc.options: --namespace-map http://www.nemsis.org= --root-element EMSDataSet #--generate-doxygen --extern-xml-schema xml-schema.xsd --generate-default-ctor --hxx-prologue #include "nillable-type.hxx" ifc-custom.options: --custom-type DateTime=::simple_nillable_type Then I combined command line statements 2 & 3 to be just: C:\NEMSISReader\NEMSISV2Reader\NEMSIS_XSDs_v2.2.1>xsd cxx-tree --options-file common.options --options-file ifc.options --options-file ifc-custom.options EMSDataSet.xsd when I re-added EMSDataSet.hxx and EMSDataSet.cxx to my project and rebuilt I get errors like: Error 2 error C3203: 'simple_nillable_type' : unspecialized class template can't be used as a template argument for template parameter 'T', expected a real type c:\nemsisreader\nemsisv2reader\nemsisv2reader\EMSDataSet.hxx 15918 1 NEMSISV2Reader Please help, and thanks. Brian On Thu, Dec 29, 2011 at 6:17 AM, Boris Kolpackov wrote: > Hi Brian, > > B Hart writes: > > > The ifc.zip example project you pointed me to is specific to another XSD > > user's project. I don't understand what exactly you are doing with in > the > > .options files, so can you please provide additional instructions on how > to > > properly use nillable-type.hxx? > > > > The XSDs that I must conform with are found here: > > http://www.nemsis.org/v2/downloads/emsDataset.html > > Unfortunately we don't have the resources to provide detail instructions > for each specific schema. The mailing list thread I mentioned in my > previous reply shows how to do this for some schema and the same idea > can be equally applied to other schemas. In short, the approach uses the > type customization mechanism in C++/Tree[1] to wrap each type that is > used in a nillable element with a C++ class template that provides the > nillable semantics. Also if you have a specific question about any part > of the implementation, please feel free to ask. > > [1] http://wiki.codesynthesis.com/Tree/Customization_guide > > Boris > From boris at codesynthesis.com Fri Dec 30 08:48:32 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Dec 30 08:49:04 2011 Subject: [xsd-users] nillable="true" In-Reply-To: References: Message-ID: <20111230134832.GA28338@tpad> Hi Brian, B Hart writes: > I'm having trouble making sense of what's in ifc.zip. Files are not > commented and there are missing xsd files. I believe the link to the .xsd files is in one of the earlier emails in this thread. > The readme's first XSD command line statement: > xsd cxx-tree --options-file common.options --generate-xml-schema > xml-schema.xsd > This generates has definitions for all the schema built-in types into a > separate .hxx. I noted that the file I originally generated from my NEMSIS > EMSDataSet.xsd had the includes for all .hxx files related to schema > built-in types, and all the type defines for the C++ namespace > "xml_schema". When I regenerate EMSDataSet.hxx and EMSDataSet.cxx I see > that the xml-schema includes and typedefs are no longer embedded, rather > included indirectly via nillable-type.hxx. So I'm assuming that you > generated xml_schema stuff in a separate file just for good organization? Not exactly. The nillable-type.hxx header needs some of the built-in definitions (as you can see, it includes xml-schema.hxx). > I now understand that ifc.options should contain just the XSD command line > parameters the I would normally use for generating .hxx and .cxx from my > NEMSIS schema. Since I don't use --generate-polymorphic or > --generate-default-ctor I'm not sure whether in my case they're needed or > not? You need --generate-default-ctor for the *_nillable_type wrappers to work. > Per the command line statements: > xsd cxx-tree --options-file common.options --options-file ifc.options ex.xsd > xsd cxx-tree --options-file common.options --options-file ifc.options > --options-file ifc-custom.options --parts 10 IFC2X3.xsd > > ex.xsd and IFC2X3.xsd are the missing files I mentioned. I'm assuming that > one of these would correspond to my EMSDataSet.xsd, but I'm not sure which > one, or why there are two steps here instead of one??? That's how the IFC schemas are organized. You will need just one command line (like for ex.xsd) if you have only one schema. > So anyway, per my modified versions of two of the files in ifc.zip (I > understand I didn't have to keep the same file names, but kept them the > same while I'm trying to make sense of this): > > ifc.options: > --namespace-map http://www.nemsis.org= > --root-element EMSDataSet > #--generate-doxygen > > --extern-xml-schema xml-schema.xsd > --generate-default-ctor > --hxx-prologue #include "nillable-type.hxx" > > ifc-custom.options: > > --custom-type DateTime=::simple_nillable_type Please read the customization guide[1] to learn what the argument of the --custom-type option means (I realize it is easier to ask me to just give you the correct answer but as I mentioned in my previous email we don't have the resources to write your application for you). That option should be: --custom-type DateTime=::simple_nillable_type/DateTimeBase Also make sure that DateTime is a simple type. Otherwise use complex_nillable_type. [1] http://wiki.codesynthesis.com/Tree/Customization_guide Boris From bhartsb at gmail.com Fri Dec 30 11:53:37 2011 From: bhartsb at gmail.com (B Hart) Date: Fri Dec 30 11:53:45 2011 Subject: [xsd-users] nillable="true" In-Reply-To: <20111230134832.GA28338@tpad> References: <20111230134832.GA28338@tpad> Message-ID: Hi Boris, I did read the customization guide, and what was written about --custom-type was not at all clear to me. DateTime is a simple type defined in my schema. simple_nillable_type is to be a templated class wrapper for DateTime. Template instantiation syntax I'm used is written like: vector v; The customization guide says "The *name* component specifies the name of a type as defined in the schema being compiled", so "--custom-type DateTime=" makes sense. I don't understand: =::simple_nillable_type/DateTimeBase what is DateTimeBase? There is no DateTimeBase defined anywhere. The guide says: "The optional *type* component is the name of a C++ type that should be used instead of the generated type" That is confusing. Is the guide saying simple_nillable_type should be used instead of DateTime??? simple_nillable_type is the name of the class template. Are you meaning the name of the instantiated C++ type? E.G. vector v; // v would be the instantiated class of vector. Everything in the schema files as written use DateTime. E.G. Here's an element defined that is of that type: I would expect: simple_nillable_type How or why is it DateTimeBase? Here's the simple schema type defined: As you can see I'm confused. On Fri, Dec 30, 2011 at 5:48 AM, Boris Kolpackov wrote: > Hi Brian, > > B Hart writes: > > > I'm having trouble making sense of what's in ifc.zip. Files are not > > commented and there are missing xsd files. > > I believe the link to the .xsd files is in one of the earlier emails > in this thread. > > > > The readme's first XSD command line statement: > > xsd cxx-tree --options-file common.options --generate-xml-schema > > xml-schema.xsd > > This generates has definitions for all the schema built-in types into a > > separate .hxx. I noted that the file I originally generated from my > NEMSIS > > EMSDataSet.xsd had the includes for all .hxx files related to schema > > built-in types, and all the type defines for the C++ namespace > > "xml_schema". When I regenerate EMSDataSet.hxx and EMSDataSet.cxx I see > > that the xml-schema includes and typedefs are no longer embedded, rather > > included indirectly via nillable-type.hxx. So I'm assuming that you > > generated xml_schema stuff in a separate file just for good organization? > > Not exactly. The nillable-type.hxx header needs some of the built-in > definitions (as you can see, it includes xml-schema.hxx). > > > > I now understand that ifc.options should contain just the XSD command > line > > parameters the I would normally use for generating .hxx and .cxx from my > > NEMSIS schema. Since I don't use --generate-polymorphic or > > --generate-default-ctor I'm not sure whether in my case they're needed or > > not? > > You need --generate-default-ctor for the *_nillable_type wrappers to work. > > > > Per the command line statements: > > xsd cxx-tree --options-file common.options --options-file ifc.options > ex.xsd > > xsd cxx-tree --options-file common.options --options-file ifc.options > > --options-file ifc-custom.options --parts 10 IFC2X3.xsd > > > > ex.xsd and IFC2X3.xsd are the missing files I mentioned. I'm assuming > that > > one of these would correspond to my EMSDataSet.xsd, but I'm not sure > which > > one, or why there are two steps here instead of one??? > > That's how the IFC schemas are organized. You will need just one command > line (like for ex.xsd) if you have only one schema. > > > > So anyway, per my modified versions of two of the files in ifc.zip (I > > understand I didn't have to keep the same file names, but kept them the > > same while I'm trying to make sense of this): > > > > ifc.options: > > --namespace-map http://www.nemsis.org= > > --root-element EMSDataSet > > #--generate-doxygen > > > > --extern-xml-schema xml-schema.xsd > > --generate-default-ctor > > --hxx-prologue #include "nillable-type.hxx" > > > > ifc-custom.options: > > > > --custom-type DateTime=::simple_nillable_type > > Please read the customization guide[1] to learn what the argument > of the --custom-type option means (I realize it is easier to ask me > to just give you the correct answer but as I mentioned in my previous > email we don't have the resources to write your application for you). > That option should be: > > --custom-type DateTime=::simple_nillable_type/DateTimeBase > > Also make sure that DateTime is a simple type. Otherwise use > complex_nillable_type. > > [1] http://wiki.codesynthesis.com/Tree/Customization_guide > > Boris > From boris at codesynthesis.com Sat Dec 31 03:02:22 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sat Dec 31 03:02:52 2011 Subject: [xsd-users] nillable="true" In-Reply-To: References: <20111230134832.GA28338@tpad> Message-ID: Hi Brian, B Hart writes: > I don't understand: > > =::simple_nillable_type/DateTimeBase > > what is DateTimeBase? There is no DateTimeBase defined anywhere. The customization guide actually has an example of exactly this usage right at the beginning. I don't really see any better way to explain this, so I am just going to quote the guide: " Now what if all we want to do is add a simple function to the names type? It would be too much work if we had to implement all the code that gets generated ourselves. Fortunately we don't have to. We can ask the compiler to generate the standard mapping with a different name and then inherit our custom type from it: --custom-type names=/names_base This would result in the following C++ code: namespace hello { class names_base; class names; class names_base { ... }; } Later, in our implementation of the names class, we can use names_base as a base. Here is another example: --custom-type names=::templates::names/names_base This results in the following C++ code being generated: namespace hello { class names_base; typedef ::templates::names names; class names_base { ... }; } " Boris