From boris at codesynthesis.com Tue Mar 1 08:28:39 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Mar 1 08:27:21 2011 Subject: [xsd-users] enumerations not exported in dll when "generate-inline" enabled In-Reply-To: References: Message-ID: Hi Matt, Matt Burnham writes: > The resulting class is put in a DLL and when I try and link an application > with the DLL, I get the following link error: > unresolved external symbol "public: static char const * const * const tmp::action::_xsd_action_literals_" (?_xsd_action_literals_@action@tmp@@2QBQBDB) Your DLL export file has the following definitions: # ifdef MY_DLL_EXPORT # define MY_DLL_DECL __declspec(dllexport) # elif MY_DLL_IMPORT # define MY_DLL_DECL __declspec(dllimport) # else # define MY_DLL_DECL // for static lib # endif In particular, it does not import things by default; one has to explicitly define MY_DLL_IMPORT for that to happen. Naturally, your test does not define this macro. If add it to the preprocessor definitions in its project file, everything links fine. Boris From alessandro.carpi at gmail.com Tue Mar 1 15:05:30 2011 From: alessandro.carpi at gmail.com (Alessandro Carpi) Date: Tue Mar 1 15:05:57 2011 Subject: [xsd-users] Report line number when error is encountered Message-ID: Hi, I am very happy to use XSD C++/Parser for a personal project in which actually I'm involved. I have a simple question: is there a way to raise an XML exception when a particular condition was encountered during the parsing of a file? Specifically, I have a language that internally uses bison to parse an expression, something like this: [stuff] [other-stuff] Obviously expressions should be written according to a specific grammar defined by the external bison parser. Actually I can recognize the event into the code which parses the attribute "expr" (the bison parser returns a null pointer). It would nice if, when this kind of errors are encountered (aka. expression parser returns a null pointer because is written wrongly) , the XML parser prints the XML line of the wrong expression. Thank you very much. -- Alessandro From mjklaim at gmail.com Wed Mar 2 03:40:12 2011 From: mjklaim at gmail.com (=?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?=) Date: Wed Mar 2 03:40:19 2011 Subject: [xsd-users] Hierarchies and code generation. Message-ID: Hi, I'm having troubles working on an xsd definition to generate an XML-format language parser in C++. Here is what I want to have in the end in C++ (in a specific namespace) : 1. an abstract class Object. It's a common interface. 2. child classes of Object : Object_Unknown, Object_Video, Object_Sprite, Object_Audio, Object_Sprite 3. an Object should have a "list" of children Object objects. As Element is abstract, the children should be of Object child class types (2.). 4. I still want to use the specific xml interface of the child types in the "list" element : <--- specific interface of a child type To achieve all this I tried several variant of the following : ...blahblah child element types... etc. etc. But the generated C++ code of list_object will never expose a sequence of "object" types, using the common interface to list all the object instances without knowing the child type. It currently expose sequences of child object types, and that follows the xsd correctly. So, is there a way to make my list_object provide a sequence of "object"? Thanks for your time. Jo?l Lamotte From ivan.lelann at free.fr Wed Mar 2 04:03:32 2011 From: ivan.lelann at free.fr (Ivan Le Lann) Date: Wed Mar 2 04:03:42 2011 Subject: [xsd-users] Hierarchies and code generation. In-Reply-To: <975839662.2447481299056598643.JavaMail.root@zimbra36-e6.priv.proxad.net> Message-ID: <1384720355.2447521299056612237.JavaMail.root@zimbra36-e6.priv.proxad.net> ----- "Klaim - Jo?l Lamotte" a ?crit : > Hi, > > I'm having troubles working on an xsd definition to generate an > XML-format > language parser in C++. > > Here is what I want to have in the end in C++ (in a specific > namespace) : > > 1. an abstract class Object. It's a common interface. > 2. child classes of Object : Object_Unknown, Object_Video, > Object_Sprite, > Object_Audio, Object_Sprite > 3. an Object should have a "list" of children Object objects. As > Element is > abstract, the children should be of Object child class types (2.). > 4. I still want to use the specific xml interface of the child types > in the > "list" element : > > > > > <--- specific > interface > of a child type > > > > > > To achieve all this I tried several variant of the following : > > > > ...blahblah > > > > > > > > child element types... > > > > > etc. > > > > > > > > etc. > > > > But the generated C++ code of list_object will never expose a sequence > of > "object" types, using > the common interface to list all the object instances without knowing > the > child type. Indeed. I fail to see how it could when that information is not in the schema. > So, is there a way to make my list_object provide a sequence of > "object"? > See the schema taken from XSD/e Hybrid "polymorphic" example below. I have no XSD distribution now on my computer, but I guess a similar example is in there too. Regards, Ivan From mjklaim at gmail.com Wed Mar 2 04:15:36 2011 From: mjklaim at gmail.com (=?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?=) Date: Wed Mar 2 04:15:44 2011 Subject: [xsd-users] Hierarchies and code generation. In-Reply-To: <1384720355.2447521299056612237.JavaMail.root@zimbra36-e6.priv.proxad.net> References: <975839662.2447481299056598643.JavaMail.root@zimbra36-e6.priv.proxad.net> <1384720355.2447521299056612237.JavaMail.root@zimbra36-e6.priv.proxad.net> Message-ID: 2011/3/2 Ivan Le Lann > ="person"/> O__O I think that's the part I didn't know about. I'm not sure I understand it fully though, because of the use of elements outside of complexType definition (I have only the root element in my xsd) Why is an element required for the base (root) type? Should I do this for my abstract element types? Thank you very much! Jo?l From victor.manoliu at yahoo.com Wed Mar 2 05:03:47 2011 From: victor.manoliu at yahoo.com (Adrian Victor Manoliu) Date: Wed Mar 2 05:03:54 2011 Subject: [xsd-users] CityGML deserialization - CityModel generation In-Reply-To: References: <995783.93915.qm@web45504.mail.sp1.yahoo.com> <399571.66645.qm@web45511.mail.sp1.yahoo.com> <392645.14182.qm@web45503.mail.sp1.yahoo.com> Message-ID: <645117.22384.qm@web45512.mail.sp1.yahoo.com> Hello, Thanks for the casting method advice, however I still don't have anything to iterate upon, after the parsing is done. From what I've seen, the only way to go through the created elements is via the _GenericApplicationPropertyOfCityModel_(const_)iterator. In this case, this iterator does not work because the begin() and end() methods look in the v_ field, which is empty. The field where the items exist perfectly well is container_, but I don't have access to that through any public method. Adrian ----- Original Message ---- From: Boris Kolpackov To: Adrian Victor Manoliu Cc: xsd-users@codesynthesis.com Sent: Mon, February 28, 2011 3:48:35 PM Subject: Re: [xsd-users] CityGML deserialization - CityModel generation Hi Adrian, Adrian Victor Manoliu writes: > const std::string fName = "waldbruecke_v1.0.0.gml"; > std::auto_ptr iCity(CityModel(fName, flags.dont_validate)); > > [...] > > Now, once I have iCity, I simply want to iterate over its elements, that > is the Buildings, BuildingParts etc. by doing something like this (I have > been doing this from the start): > > CityModelType::_GenericApplicationPropertyOfCityModel_const_iterator ci; > > for (ci = iCity->_GenericApplicationPropertyOfCityModel().begin(); > ci != iCity->_GenericApplicationPropertyOfCityModel().end(); > ++ci) > { > [...] > } > > however in this case I don't see how I could know what type to cast these > objects to You need to study the GML/CityGML schemas to see which concrete elements (and types) substitute which abstract elements. Here is an example body of the above for-loop. Hopefully, it will get you started: for (ci = iCity->_GenericApplicationPropertyOfCityModel().begin(); ci != iCity->_GenericApplicationPropertyOfCityModel().end(); ++ci) { xml_schema::type& x (*ci); if (gml::FeaturePropertyType* cityObjectMember = dynamic_cast (&x)) { gml::FeaturePropertyType::_Feature_const_iterator fi; for (fi = cityObjectMember->_Feature ().begin (); fi != cityObjectMember->_Feature ().end (); ++fi) { gml::AbstractFeatureType& f (*fi); if (citygml::building::BuildingType* b = dynamic_cast (&f); { // We've got a building. } else if (...) { ... } } } } Boris From victor.manoliu at yahoo.com Wed Mar 2 05:08:07 2011 From: victor.manoliu at yahoo.com (Adrian Victor Manoliu) Date: Wed Mar 2 05:08:15 2011 Subject: [xsd-users] CityGML deserialization - CityModel generation In-Reply-To: References: <995783.93915.qm@web45504.mail.sp1.yahoo.com> <399571.66645.qm@web45511.mail.sp1.yahoo.com> <392645.14182.qm@web45503.mail.sp1.yahoo.com> Message-ID: <784323.88556.qm@web45505.mail.sp1.yahoo.com> Hello, Thanks for the casting method advice, however I still don't have anything to iterate upon, after the parsing is done. From what I've seen, the only way to go through the created elements is via the _GenericApplicationPropertyOfCityModel_(const_)iterator. In this case, this iterator does not work because the begin() and end() methods look in the v_ field, which is empty. The field where the items exist perfectly well is container_, but I don't have access to that through any public method. Adrian ----- Original Message ---- From: Boris Kolpackov To: Adrian Victor Manoliu Cc: xsd-users@codesynthesis.com Sent: Mon, February 28, 2011 3:48:35 PM Subject: Re: [xsd-users] CityGML deserialization - CityModel generation Hi Adrian, Adrian Victor Manoliu writes: > const std::string fName = "waldbruecke_v1.0.0.gml"; > std::auto_ptr iCity(CityModel(fName, flags.dont_validate)); > > [...] > > Now, once I have iCity, I simply want to iterate over its elements, that > is the Buildings, BuildingParts etc. by doing something like this (I have > been doing this from the start): > > CityModelType::_GenericApplicationPropertyOfCityModel_const_iterator ci; > > for (ci = iCity->_GenericApplicationPropertyOfCityModel().begin(); > ci != iCity->_GenericApplicationPropertyOfCityModel().end(); > ++ci) > { > [...] > } > > however in this case I don't see how I could know what type to cast these > objects to You need to study the GML/CityGML schemas to see which concrete elements (and types) substitute which abstract elements. Here is an example body of the above for-loop. Hopefully, it will get you started: for (ci = iCity->_GenericApplicationPropertyOfCityModel().begin(); ci != iCity->_GenericApplicationPropertyOfCityModel().end(); ++ci) { xml_schema::type& x (*ci); if (gml::FeaturePropertyType* cityObjectMember = dynamic_cast (&x)) { gml::FeaturePropertyType::_Feature_const_iterator fi; for (fi = cityObjectMember->_Feature ().begin (); fi != cityObjectMember->_Feature ().end (); ++fi) { gml::AbstractFeatureType& f (*fi); if (citygml::building::BuildingType* b = dynamic_cast (&f); { // We've got a building. } else if (...) { ... } } } } Boris From boris at codesynthesis.com Wed Mar 2 08:55:19 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Mar 2 08:54:06 2011 Subject: [xsd-users] Hierarchies and code generation. In-Reply-To: References: <975839662.2447481299056598643.JavaMail.root@zimbra36-e6.priv.proxad.net> <1384720355.2447521299056612237.JavaMail.root@zimbra36-e6.priv.proxad.net> Message-ID: Hi Jo?l, Klaim - Jo?l Lamotte writes: > I'm not sure I understand it fully though, because of the use of elements > outside of complexType definition (I have only the root element in my xsd) > > Why is an element required for the base (root) type? > Should I do this for my abstract element types? That's how the substitution groups mechanism works in XML Schema. For XSD-specific details on this feature, see Section 2.11, "Mapping for xsi:type and Substitution Groups" in the C++/Tree Mapping User Manual: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.11 Boris From boris at codesynthesis.com Wed Mar 2 09:11:57 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Mar 2 09:10:44 2011 Subject: [xsd-users] Report line number when error is encountered In-Reply-To: References: Message-ID: Hi Alessandro, Alessandro Carpi writes: > It would nice if, when this kind of errors are encountered (aka. expression > parser returns a null pointer because is written wrongly) , the XML parser > prints the XML line of the wrong expression. In other words you want to get the line/column information of the current position so that you can print it together with your application-specific error. The way to get to this information depends on the underlying XML parser you are using (Expat or Xerces-C++). But the general approach would be to create the parser yourself, then use this parser to parse the document and query it for the current line/column information in case of an error. This is fairly easy to implement with Expat and slightly more difficult with Xerces-C++. Boris From mjklaim at gmail.com Wed Mar 2 09:32:31 2011 From: mjklaim at gmail.com (=?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?=) Date: Wed Mar 2 09:32:40 2011 Subject: [xsd-users] Hierarchies and code generation. In-Reply-To: References: <975839662.2447481299056598643.JavaMail.root@zimbra36-e6.priv.proxad.net> <1384720355.2447521299056612237.JavaMail.root@zimbra36-e6.priv.proxad.net> Message-ID: > > > > Why is an element required for the base (root) type? > > Should I do this for my abstract element types? > > That's how the substitution groups mechanism works in XML Schema. > > For XSD-specific details on this feature, see Section 2.11, "Mapping for > xsi:type and Substitution Groups" in the C++/Tree Mapping User Manual: > > > http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.11 > > Boris > Thank your very very very much, that's the answer to all my questions. :D From alessandro.carpi at gmail.com Wed Mar 2 09:35:49 2011 From: alessandro.carpi at gmail.com (Alessandro Carpi) Date: Wed Mar 2 09:36:16 2011 Subject: [xsd-users] Report line number when error is encountered In-Reply-To: References: Message-ID: 2011/3/2 Boris Kolpackov > Hi Alessandro, > > Alessandro Carpi writes: > > > It would nice if, when this kind of errors are encountered (aka. > expression > > parser returns a null pointer because is written wrongly) , the XML > parser > > prints the XML line of the wrong expression. > > In other words you want to get the line/column information of the current > position so that you can print it together with your application-specific > error. > Actually yes. I was thinking to throw a sort of "not valid xml exception" in order to obtain the printing of line and column for free :-) > > The way to get to this information depends on the underlying XML parser > you are using (Expat or Xerces-C++). But the general approach would be > to create the parser yourself, then use this parser to parse the document > and query it for the current line/column information in case of an error. > This is fairly easy to implement with Expat and slightly more difficult > with Xerces-C++. > > I'm using Xercesc-C++ because it is already present to the target system. If the above solution is not praticable, how can I obtain such informations from the underlying parser ? Thank you very much :-) -- -- Alessandro Carpi From boris at codesynthesis.com Wed Mar 2 09:49:10 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Mar 2 09:47:58 2011 Subject: [xsd-users] Report line number when error is encountered In-Reply-To: References: Message-ID: Hi Alessandro, Alessandro Carpi writes: > Actually yes. I was thinking to throw a sort of "not valid xml exception" > in order to obtain the printing of line and column for free :-) Yes, this approach is probably the easiest. Simply derive your own exception class from schema_exception like this: #include struct my_exception: xsd::cxx::parser::schema_exception { virtual std::string message () const { return "..."; } }; And throw it from one of the callbacks. You should then see the message along with the file/line/column information as if it was an XML validation error. Boris From alessandro.carpi at gmail.com Wed Mar 2 11:40:11 2011 From: alessandro.carpi at gmail.com (Alessandro Carpi) Date: Wed Mar 2 11:40:42 2011 Subject: [xsd-users] Report line number when error is encountered In-Reply-To: References: Message-ID: 2011/3/2 Boris Kolpackov > Hi Alessandro, > > Alessandro Carpi writes: > > > Actually yes. I was thinking to throw a sort of "not valid xml > exception" > > in order to obtain the printing of line and column for free :-) > > Yes, this approach is probably the easiest. Simply derive your own > exception > class from schema_exception like this: > > #include > > struct my_exception: xsd::cxx::parser::schema_exception > { > virtual std::string > message () const > { > return "..."; > } > }; > > And throw it from one of the callbacks. You should then see the message > along > with the file/line/column information as if it was an XML validation error. > > Boris > Thank you! It is exactly what i need :-) -- -- Alessandro Carpi From stargate625 at gmail.com Thu Mar 3 12:49:15 2011 From: stargate625 at gmail.com (William Canton) Date: Thu Mar 3 14:44:07 2011 Subject: [xsd-users] Error in building the generated header due to XSD runtime version mismatch Message-ID: I am not sure how I got the following fatal error during the build on the VC++ 9.0: fatal error C1189: #error : XSD runtime version mismatch This error was reported in one of my generated *.hxx file at the line: #if (XSD_INT_VERSION != 3030000L) #error XSD runtime version mismatch #endif But hovering over the macro XSD_INT_VERSION showed a correct version number of 3030000L. How could this happen? Wiilliam From boris at codesynthesis.com Thu Mar 3 15:00:02 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Mar 3 14:59:04 2011 Subject: [xsd-users] Error in building the generated header due to XSD runtime version mismatch In-Reply-To: References: Message-ID: Hi William, William Canton writes: > This error was reported in one of my generated *.hxx file at the line: > > #if (XSD_INT_VERSION != 3030000L) > #error XSD runtime version mismatch > #endif > > But hovering over the macro XSD_INT_VERSION showed a correct version number > of 3030000L. How could this happen? Hm, this is strange. Does it happen with all the generated files or only this one? Also, can you open (by right-clicking on it in the source code and selecting the "Open Document" menu item) the file that is included at the beginning of the generated header file. Then do the same for and see if the version defined there is correct. You may also want to double check if there is a previous version of XSD installed somewhere on your machine. Boris From stargate625 at gmail.com Thu Mar 3 17:23:57 2011 From: stargate625 at gmail.com (William Canton) Date: Fri Mar 4 10:21:43 2011 Subject: [xsd-users] Error in building the generated header due to XSD runtime version mismatch In-Reply-To: References: Message-ID: Hi Boris, I eventually found out that my workspace in Visual Studio C++ has multiple projects. As it happened, some of the projects still referenced the old 3.2 version. After I fixed all the project properties, the CodeSynthesis could generate the version number embedded in the corresponding *.hxx files correctly. However, there is another problem though. The CodeSynthesis doesn't seem to be able to parse a valid XML document with optional field elements. For example, if my XML file contains an empty optional , the xerces parser would throw exception at runtime. Again, it took me a while to discover this problem by removing the empty EISSDescriptor elements from the XML document. Is this a bug in the CodeSynthesis? Attached is the standard XML schema file that I used to generate the classes. Please try it to see if you will encounter the same anomaly that I stumbled upon. William On Thu, Mar 3, 2011 at 3:00 PM, Boris Kolpackov wrote: > Hi William, > > William Canton writes: > > > This error was reported in one of my generated *.hxx file at the line: > > > > #if (XSD_INT_VERSION != 3030000L) > > #error XSD runtime version mismatch > > #endif > > > > But hovering over the macro XSD_INT_VERSION showed a correct version > number > > of 3030000L. How could this happen? > > Hm, this is strange. Does it happen with all the generated files or only > this > one? > > Also, can you open (by right-clicking on it in the source code and > selecting > the "Open Document" menu item) the file that is > included > at the beginning of the generated header file. Then do the same for > and see if the version defined there is correct. > > You may also want to double check if there is a previous version of XSD > installed somewhere on your machine. > > Boris > -------------- next part -------------- A non-text attachment was scrubbed... Name: BigHunt_example.xml Type: text/xml Size: 11255 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20110303/9b2f21b9/BigHunt_example-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: standard_cdf.xsd Type: application/octet-stream Size: 75353 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20110303/9b2f21b9/standard_cdf-0001.obj From rlischner at proteuseng.com Fri Mar 4 09:49:54 2011 From: rlischner at proteuseng.com (Ray Lischner) Date: Fri Mar 4 10:21:44 2011 Subject: [xsd-users] shared objects that load compiled schemas from a shared object Message-ID: We are using RedHat Linux 5.x, g++ 4.1.2, xsd 3.3.0. We compile a set of schemas that use substitutionGroups into a shared object X.so. We build two more shared objects, A.so and B.so, which make use of the schemas in X.so. We build A.so and B.so with -lX. When we load A.so and B.so into an application, the substitutionGroups don't work. That is, a dynamic_cast() of an object of type Type returns a null pointer. When the same code executes with only A.so loaded, or only B.so loaded, the code works. It fails only when we load A.so and B.so into the same process space. If we set LD_PRELOAD=X.so, the program works with A.so and B.so loaded. Is there a way we can make this work without the LD_PRELOAD? I thought the loader would be able to detect that it needs to load only one copy of X.so, but apparently I am mistaken. 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 This electronic message and any files transmitted with it contain information which may be privileged and/or proprietary. The information is intended for use solely by the intended recipient(s). If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of this information is prohibited. If you have received this electronic message in error, please advise the sender by reply email or by telephone (443.539.3400) and delete the message. From boris at codesynthesis.com Fri Mar 4 10:31:08 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Mar 4 10:30:10 2011 Subject: [xsd-users] Error in building the generated header due to XSD runtime version mismatch In-Reply-To: References: Message-ID: Hi William, William Canton writes: > However, there is another problem though. The CodeSynthesis doesn't seem to > be able to parse a valid XML document with optional field elements. Your XML is invalid per your schema. EISSDescriptorType has the following definition: ... Which means that the Data element must be present in every EISSDescriptor element. I think you are confusing minOccurs="0" with empty content. When you see something like this: ... Then the minOccurs="0" is at play here. However, if you see something like this: ... Then the element is present and the empty content must be allowed by the element's type (EISSDescriptorType in this case). EISSDescriptorType clearly does not allow empty content. Boris From stargate625 at gmail.com Fri Mar 4 12:39:19 2011 From: stargate625 at gmail.com (William Canton) Date: Sat Mar 5 04:52:10 2011 Subject: [xsd-users] Error in building the generated header due to XSD runtime version mismatch In-Reply-To: References: Message-ID: Hi Boris, Thank you for pointing out the required Data element within the EISSDescriptorType element. Indeed, the Data element is required to be non-empty once presented. The XML document was generated from a tool and I just assumed that it was created properly. I tested the same document on Java platform and didn't see any problem. Java XML parser seems more lenient than the CodeSynthesis parser in this regard. William On Fri, Mar 4, 2011 at 10:31 AM, Boris Kolpackov wrote: > Hi William, > > William Canton writes: > > > However, there is another problem though. The CodeSynthesis doesn't seem > to > > be able to parse a valid XML document with optional field elements. > > Your XML is invalid per your schema. EISSDescriptorType has the following > definition: > > > > > maxOccurs="unbounded"/> > > ... > > > Which means that the Data element must be present in every EISSDescriptor > element. > > I think you are confusing minOccurs="0" with empty content. > > When you see something like this: > > > > ... > > > Then the minOccurs="0" is at play here. However, if you see something > like this: > > > > ... > > > Then the element is present and the empty content must be allowed by the > element's type (EISSDescriptorType in this case). EISSDescriptorType > clearly > does not allow empty content. > > Boris > From jclements at comcast.net Sat Mar 5 22:14:03 2011 From: jclements at comcast.net (Jeff Clements) Date: Sun Mar 6 08:02:19 2011 Subject: [xsd-users] C++/Tree parsing: expected element exception query Message-ID: <000001cbdbac$8ce496c0$a6adc440$@net> When attempting to parse an XML document using a C++/Tree generated parser, I get an Expected Element exception that looks like this: Exception: expected element my.name.space#minimized The "my.name.space" namespace, I believe, is properly formatted (as I get an unexpected exception if I modify it in any way), so I'm wondering what other checks are being performed that could cause the exception to be thrown? Also, what is the significance of the "minimized" message? Thanks in advance for any advice. Jeff From alessandro.carpi at gmail.com Sun Mar 6 10:18:21 2011 From: alessandro.carpi at gmail.com (Alessandro Carpi) Date: Sun Mar 6 10:18:48 2011 Subject: [xsd-users] [C++/Parser] Passing arguments to the document parser Message-ID: Hello people, I am using C++/Parser and I have a simple question: is there a way to pass a specific argument to the document parser, it will be visible from my callbacks ? I have a data structure that is filled outside the code implementing my parser, but I need to use such structure in order to verify if informations read from the XML are consistent with what I should expect. For instance, such data structure contains a list of possibile names. When an attribute "name" was parsed I must check if the value is present into this names' list. Thank you very much, -- -- Alessandro Carpi From boris at codesynthesis.com Mon Mar 7 07:56:13 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Mar 7 07:55:31 2011 Subject: [xsd-users] Error in building the generated header due to XSD runtime version mismatch In-Reply-To: References: Message-ID: Hi William, William Canton writes: > The XML document was generated from a tool and I just assumed that it was > created properly. I tested the same document on Java platform and didn't > see any problem. Java XML parser seems more lenient than the CodeSynthesis > parser in this regard. This is a very basic validation rule and I would be very surprised if any well-known Java parser ignored it. Something else most likely is going on (like the Java parser cannot find the schema and disables validation altogether because of that; this is the default behavior in Xerces-J, for example). Boris From boris at codesynthesis.com Mon Mar 7 08:23:33 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Mar 7 08:22:52 2011 Subject: [xsd-users] shared objects that load compiled schemas from a shared object In-Reply-To: References: Message-ID: Hi Ray, Ray Lischner writes: > When we load A.so and B.so into an application, the substitutionGroups > don't work. That is, a dynamic_cast() of an object of type Type > returns a null pointer. Found this seemingly relevant discussion: http://stackoverflow.com/questions/2351786/dynamic-cast-fails-when-used-with-dlopen-dlsym Boris From boris at codesynthesis.com Mon Mar 7 08:32:55 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Mar 7 08:32:13 2011 Subject: [xsd-users] C++/Tree parsing: expected element exception query In-Reply-To: <000001cbdbac$8ce496c0$a6adc440$@net> References: <000001cbdbac$8ce496c0$a6adc440$@net> Message-ID: Hi Jeff, Jeff Clements writes: > Exception: expected element my.name.space#minimized The "my.name.space" is the namespace and "minimized" is the name of the expected root document element. When you call one of the parsing functions, it expects to find the corresponding element as the root document element. If the element namespace/name does not match, you get this exception. If you want to handle documents with varying root elements, check the 'multiroot' example in the XSD distribution. Boris From boris at codesynthesis.com Mon Mar 7 08:37:15 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Mar 7 08:36:33 2011 Subject: [xsd-users] [C++/Parser] Passing arguments to the document parser In-Reply-To: References: Message-ID: Hi Alessandro, Alessandro Carpi writes: > I am using C++/Parser and I have a simple question: is there a way to pass a > specific argument to the document parser, it will be visible from my > callbacks ? No, but you can pass anything you want to the parser implementation's constructors. > I have a data structure that is filled outside the code implementing my > parser, but I need to use such structure in order to verify if informations > read from the XML are consistent with what I should expect. > > For instance, such data structure contains a list of possibile names. When > an attribute "name" was parsed I must check if the value is present into > this names' list. You could pass/store a reference to this data structure in the parser implementation that handles the "name" attribute. This way you can change the list of names between the parse sessions if you would like to reuse the same set of parsers to parse multiple documents. Boris From js.homer at yahoo.com Thu Mar 17 19:55:02 2011 From: js.homer at yahoo.com (Homer J S) Date: Thu Mar 17 19:55:11 2011 Subject: [xsd-users] How to get around invalid characters in UTF-8 string Message-ID: <399415.65185.qm@web45604.mail.sp1.yahoo.com> Hello everyone, When parsing an UTF-8 encode xml file I got the following error from the parser: "An exception occurred! Type:UTFDataFormatException, Message:Exceede bytes limits , 6-byte sequence" I believe the reason is due to a string that contain invalid byte sequence for UTF-8 encoding. I am on the receiver side of this xml message and cannot control what's in it. Is there a way to to get the parser to bypass those characters, strip them out, or replace them with something else? Many thanks, JS From fschmidt at techfak.uni-bielefeld.de Fri Mar 18 05:46:42 2011 From: fschmidt at techfak.uni-bielefeld.de (Florian Paul Schmidt) Date: Fri Mar 18 05:47:03 2011 Subject: [xsd-users] How to get around invalid characters in UTF-8 string In-Reply-To: <399415.65185.qm@web45604.mail.sp1.yahoo.com> References: <399415.65185.qm@web45604.mail.sp1.yahoo.com> Message-ID: <4D832A02.8060009@techfak.uni-bielefeld.de> On 03/18/2011 12:55 AM, Homer J S wrote: > Hello everyone, > When parsing an UTF-8 encode xml file I got the following error from the parser: > > "An exception occurred! Type:UTFDataFormatException, Message:Exceede bytes > limits , 6-byte sequence" > > I believe the reason is due to a string that contain invalid byte sequence for > UTF-8 encoding. I am on the receiver side of this xml message and cannot control > what's in it. > > Is there a way to to get the parser to bypass those characters, strip them out, > or replace them with something else? > > Many thanks, > > JS This doesn't sound like a job for the parser really. Aren't there nice usable unicode libraries that you can use to filter the input before passing it to the parser? Flo > > From mikhail.evstiounin at gmail.com Thu Mar 17 19:28:57 2011 From: mikhail.evstiounin at gmail.com (Mikhail Evstiounin) Date: Fri Mar 18 09:33:21 2011 Subject: [xsd-users] XSD C++ code generation error Message-ID: Hi, XSD generated the following code: hxx file: namespace xml_schema { ? ? typedef ::xsd::cxx::tree::type type; ? namespace up { ? class results: public ::xml_schema::type { ? static const success_type success_default_value_; ? }; ? } ? } cxx file: namespace xml_schema { ? namespace up { ? typedef ::xml_schema::type success_type; ? const results::success_type results::success_default_value_( ); ? } ? } It produces the following error (gcc 4.1.1): document-envelope.cxx:2882: error: no ?const xml_schema::type up::results::success_default_value_()? member function declared in class 'up::results' document-envelope.cxx:2882: error: declaration of ?const xml_schema::type up::results::success_default_value_()? outside of class is not definition If you change it a little bit: namespace xml_schema { ? namespace up { ? const results::success_type results::success_default_value_;// ( ); ? } ? } It compiles normally. Since there is no default value this type of declaration (of a class static member) is considered as a function definition. Per many C++ name resolution discussions, rationale is made to lean to a "function definition", not a "variable declaration" -- too many code rely on it. Proposal -- to fix XSD in part of static member declaration not to use "()" if default c-tor is used. Truly yours Mikhail Evstiounin From boris at codesynthesis.com Fri Mar 18 09:42:51 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Mar 18 09:43:20 2011 Subject: [xsd-users] How to get around invalid characters in UTF-8 string In-Reply-To: <399415.65185.qm@web45604.mail.sp1.yahoo.com> References: <399415.65185.qm@web45604.mail.sp1.yahoo.com> Message-ID: Hi, Homer J S writes: > Is there a way to to get the parser to bypass those characters, strip them > out, or replace them with something else? There is no out of the box support for this. And I agree with Florian that this is something that is better to handle before XML parsing since "bypassing", "stripping", and "replacing" can be very application- specific. Also note that such stripping can render the resulting XML malformed (e.g., by removing '<' from a closing tag). The best way to do this would be to filter the input by providing a custom input stream (e.g., an implementation of std::istream or xercesc::InputSource; the latter is probably easier). In this implementation you can either use some existing library or validate and "correct" UTF-8 yourself. You can base this on the 'compression' example from the XSD distribution which uses this technique to inflate compressed XML on the fly. Boris From boris at codesynthesis.com Fri Mar 18 10:20:10 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Mar 18 10:20:39 2011 Subject: [xsd-users] XSD C++ code generation error In-Reply-To: References: Message-ID: Hi Mikhail, Mikhail Evstiounin writes: > document-envelope.cxx:2882: error: no ?const xml_schema::type > up::results::success_default_value_()? member function declared in class > 'up::results' Fixed. Thanks for reporting this! If you would like, I can build you a pre-release binary (just let me know which platform you need). Boris From mikhail.evstiounin at gmail.com Fri Mar 18 10:31:14 2011 From: mikhail.evstiounin at gmail.com (Mikhail Evstiounin) Date: Fri Mar 18 11:04:53 2011 Subject: [xsd-users] XSD C++ code generation error In-Reply-To: References: Message-ID: Hi Boris, Thanks! If you can build pre-realese binary tehn I would appreciate it. /login/evstiomv/tests/xsd-3.3.0-i686-linux-gnu/ -- I think, it should be enough information. :) On Fri, Mar 18, 2011 at 10:20 AM, Boris Kolpackov wrote: > Hi Mikhail, > > Mikhail Evstiounin writes: > > > document-envelope.cxx:2882: error: no ?const xml_schema::type > > up::results::success_default_value_()? member function declared in class > > 'up::results' > > Fixed. Thanks for reporting this! If you would like, I can build you > a pre-release binary (just let me know which platform you need). > > Boris > From boris at codesynthesis.com Fri Mar 18 11:05:24 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Mar 18 11:05:55 2011 Subject: [xsd-users] XSD C++ code generation error In-Reply-To: References: Message-ID: Mikhail Evstiounin writes: > If you can build pre-realese binary tehn I would appreciate it. Here you go: http://www.codesynthesis.com/~boris/tmp/xsd-4.0.0.a4-i686-linux-gnu.tar.bz2 Boris From florin.hillebrand at streamunlimited.com Mon Mar 21 11:19:00 2011 From: florin.hillebrand at streamunlimited.com (Florin Hillebrand) Date: Mon Mar 21 11:19:07 2011 Subject: [xsd-users] Warning while using maxUnsignedInt with c++98 standard with xsd3.3 Message-ID: <1300720740.14135.57.camel@flozdeskub> Hi all, first my environment: - ubuntu 10.04 on x86 32bit - xsd3.3 - g++-4.4 with -stdc=c++98 -Wall compiler options. I have an xsd which generates me a element with an attribute of type xsd:unsignedInt with a default value. The default value has to be the maximal unsigned int value (4294967295). ---------- ---------- When xsd 3.2 generated the cxx-tree i got back a constant and a method: ---------- const Element::attr_type Element::attr_default_value_ ( ::xsd::cxx::tree::traits< ::xml_schema::unsigned_int, char >::create ( ::std::string ("4294967295"), 0, 0, 0)); const Element::attr_type& Element::attr_default_value () { return attr_default_value_; } --------- This works well without any compiler warnings, but when I updated xsd to 3.3 it generates me: --------- const Element::attr_type& Element::attr_default_value () { return 4294967295; } --------- This generates a g++ warning (Warnings treaded as errors): ------------ error: this decimal constant is unsigned only in ISO C90 ------------ c++98 standard says: ---cite---- ISO/IEC 14882:1998(E) page 42 point 2 ------ If it is decimal and has no suffix, it has the first of these types in which its value can be represented: int, long int; ----------- So this won't work, but: ---cite---- ISO/IEC 14882:1998(E) page 42 point 2 ------ If it is suffixed by u or U, its type is the first of these types in which its value can be represented: unsigned int, unsigned long int; ----------- This would work but i can't append an u or U to the default value, because regex wouldn't pass. I would appreciate any suggestions. With kind regards, Florin -- The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From boris at codesynthesis.com Mon Mar 21 11:55:04 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Mar 21 11:55:55 2011 Subject: [xsd-users] Warning while using maxUnsignedInt with c++98 standard with xsd3.3 In-Reply-To: <1300720740.14135.57.camel@flozdeskub> References: <1300720740.14135.57.camel@flozdeskub> Message-ID: Hi Florin, Florin Hillebrand writes: > return 4294967295; > > This generates a g++ warning (Warnings treaded as errors): > > error: this decimal constant is unsigned only in ISO C90 I believe we have already fixed this issue for the upcoming release: http://scm.codesynthesis.com/?p=xsd/xsd.git;a=commit;h=54c3d3ecf7abaac4c2239f44340f7f9dbdadfe3a You can try this pre-release binary to see if it helps your case: http://www.codesynthesis.com/~boris/tmp/xsd-4.0.0.a4-i686-linux-gnu.tar.bz2 Boris From dv7777 at gmail.com Tue Mar 22 10:44:37 2011 From: dv7777 at gmail.com (dv) Date: Tue Mar 22 10:44:45 2011 Subject: [xsd-users] custom xml parser? Message-ID: <4D88B5D5.8070602@gmail.com> Hello, I've been looking at the XSD code, and am I right to assume that adding support for an XML parser is a non-trivial task? I see code for Expat and Xerces, and it is scattered all over the place. I am trying to use a custom parser, so far I don't see how. Would this be easier with XSD/e ? From boris at codesynthesis.com Tue Mar 22 13:31:36 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Mar 22 13:32:31 2011 Subject: [xsd-users] custom xml parser? In-Reply-To: <4D88B5D5.8070602@gmail.com> References: <4D88B5D5.8070602@gmail.com> Message-ID: Hi, dv writes: > I've been looking at the XSD code, and am I right to assume that adding > support for an XML parser is a non-trivial task? I see code for Expat > and Xerces, and it is scattered all over the place. I am trying to use a > custom parser, so far I don't see how. Would this be easier with XSD/e ? Which mapping would you like to use, C++/Parser or C++/Tree? Boris From dv7777 at gmail.com Wed Mar 23 06:45:15 2011 From: dv7777 at gmail.com (dv) Date: Wed Mar 23 06:45:28 2011 Subject: [xsd-users] custom xml parser? In-Reply-To: References: <4D88B5D5.8070602@gmail.com> Message-ID: <4D89CF3B.7090100@gmail.com> On 03/22/2011 06:31 PM, Boris Kolpackov wrote: > Hi, > > dv writes: > >> I've been looking at the XSD code, and am I right to assume that adding >> support for an XML parser is a non-trivial task? I see code for Expat >> and Xerces, and it is scattered all over the place. I am trying to use a >> custom parser, so far I don't see how. Would this be easier with XSD/e ? > > Which mapping would you like to use, C++/Parser or C++/Tree? > > Boris > I would like to use the C++/Tree mapping. From boris at codesynthesis.com Wed Mar 23 09:25:59 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Mar 23 09:26:59 2011 Subject: [xsd-users] custom xml parser? In-Reply-To: <4D89CF3B.7090100@gmail.com> References: <4D88B5D5.8070602@gmail.com> <4D89CF3B.7090100@gmail.com> Message-ID: Hi, dv writes: > I would like to use the C++/Tree mapping. C++/Tree is integrated pretty tightly with Xerces-C++ (there are a number of benefits to such tight integration, including representation of wildcard/mixed content as DOM fragments, XPath support, etc). Plus, C++/Tree relies on the underlying XML parser for XML Schema validation so if your parser does not support it, then you will only be able to parse in non-validating mode. On the other hand, the C++/Hybrid mapping in XSD/e, which is similar to C++/Tree, doesn't know anything about the underlying XML parser. It is all handled by C++/Parser which in turn uses customized Expat parser and performs XML Schema validation in the generated code. It should be quite easy to customize the XSD/e runtime to use a parser other than Expat. Pretty much all teh parser-specific logic is in the libxsde/xsde/cxx/parser/expat/ directory with just a few references from the rest of the C++/Parser runtime. This would be very easy to change. If you would like to give it try and need help, feel free to ask on the xsde-users mailing list. Boris From stargate625 at gmail.com Mon Mar 28 11:43:19 2011 From: stargate625 at gmail.com (William Canton) Date: Mon Mar 28 11:56:34 2011 Subject: [xsd-users] Compiler errors occurred in the generated *.hxx files from CodeSynthesis 3.2 Message-ID: I am not sure what was causing the following compiler errors in the generated header file: 1>c:\test\generated\codf.hxx(391) : error C2146: syntax error : missing ';' before identifier 'FileSystem_type' 1>c:\test\generated\codf.hxx(391) : error C2838: 'FileSystemType' : illegal qualified name in member declaration 1>c:\test\generated\codf.hxx(391) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\test\generated\codf.hxx(392) : error C2065: 'FileSystem_type' : undeclared identifier 1>c:\test\generated\codf.hxx(393) : error C2065: 'FileSystem_type' : undeclared identifier 1>c:\test\codf.hxx(402) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\test\codf.hxx(402) : error C2143: syntax error : missing ',' before '&' 1>c:\test\generated\codf.hxx(408) : error C2065: 'FileSystem_type' : undeclared identifier 1>c:\test\generated\codf.hxx(532) : error C2079: 'CarouselType::FileSystem_' uses undefined class 'xsd::cxx::tree::optional' 1>c:\test\generated\codf.hxx(6546) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\test\generated\codf.hxx(6546) : error C2143: syntax error : missing ',' before '&' 1>MyApp.cpp The codf.hxx was generated by the CodeSynthesis after compiling the XML Schema file codf.xsd. But when I included this header file in my MyApp.cpp file, the build failed with various mysterious syntax errors while processing the codf.hxx header. When I opened the codf.hxx file, it has a snippet of content as follows surrounding the location of the reported errors: 386 void 387 OCConfiguration (const OCConfiguration_sequence& s); 388 389 // FileSystem 390 // 391 typedef ::FileSystemType FileSystem_type; 392 typedef ::xsd::cxx::tree::optional< FileSystem_type > FileSystem_optional; 393 typedef ::xsd::cxx::tree::traits< FileSystem_type, char > FileSystem_traits; It's unclear to me why my Visual Studio C++ 2008 reported an error on line number 391. The was the first build error detected. Before this line, there is a function on line 387 returning a "void" type. This could have caused the error. It seemed like the compiler somehow could not even recognize the keyword "void." Any idea what could have caused these strange compiler's behavior? William From boris at codesynthesis.com Mon Mar 28 12:02:11 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Mar 28 12:03:44 2011 Subject: [xsd-users] Compiler errors occurred in the generated *.hxx files from CodeSynthesis 3.2 In-Reply-To: References: Message-ID: Hi William, William Canton writes: > 1>c:\test\generated\codf.hxx(391) : error C2146: syntax error : missing ';' > before identifier 'FileSystem_type' > > [...] > > 391 typedef ::FileSystemType FileSystem_type; Can you check that the FileSystemType class is actually defined in the generated codf.hxx header? One thing that might be causing this is the name clash with some existing function called FileSystemType (possibly defined by one of the system headers). You can try to tell the XSD compiler that it is a reserved name with the --reserved-name option: --reserved-name FileSystemType Better yet, you may want to place the generated code into a namespace instead of the global scope. This can be achieved with the --namespace-map options: --namespace-map =codf Boris From stargate625 at gmail.com Mon Mar 28 12:10:07 2011 From: stargate625 at gmail.com (William Canton) Date: Mon Mar 28 12:14:55 2011 Subject: [xsd-users] Compiler errors occurred in the generated *.hxx files from CodeSynthesis 3.2 In-Reply-To: References: Message-ID: The FileSystemType is defined by CodeSynthesis in the same generated header codf.hxx on line 5028. There is also a forward declaration of this type on line 285 in the same header. On Mon, Mar 28, 2011 at 12:02 PM, Boris Kolpackov wrote: > Hi William, > > William Canton writes: > > > 1>c:\test\generated\codf.hxx(391) : error C2146: syntax error : missing > ';' > > before identifier 'FileSystem_type' > > > > [...] > > > > 391 typedef ::FileSystemType FileSystem_type; > > Can you check that the FileSystemType class is actually defined in the > generated codf.hxx header? > > One thing that might be causing this is the name clash with some existing > function called FileSystemType (possibly defined by one of the system > headers). You can try to tell the XSD compiler that it is a reserved > name with the --reserved-name option: > > --reserved-name FileSystemType > > Better yet, you may want to place the generated code into a namespace > instead of the global scope. This can be achieved with the --namespace-map > options: > > --namespace-map =codf > > Boris > From stargate625 at gmail.com Mon Mar 28 12:17:01 2011 From: stargate625 at gmail.com (William Canton) Date: Mon Mar 28 12:21:55 2011 Subject: [xsd-users] Compiler errors occurred in the generated *.hxx files from CodeSynthesis 3.2 In-Reply-To: References: Message-ID: Hi Boris, After adding the codf as namespace as you suggested, it created another problem: CodeSynthesis never generated any headers or cpp files from the schema. William On Mon, Mar 28, 2011 at 12:10 PM, William Canton wrote: > The FileSystemType is defined by CodeSynthesis in the same generated header > codf.hxx on line 5028. There is also a forward declaration of this type on > line 285 in the same header. > > > On Mon, Mar 28, 2011 at 12:02 PM, Boris Kolpackov > wrote: > >> Hi William, >> >> William Canton writes: >> >> > 1>c:\test\generated\codf.hxx(391) : error C2146: syntax error : missing >> ';' >> > before identifier 'FileSystem_type' >> > >> > [...] >> > >> > 391 typedef ::FileSystemType FileSystem_type; >> >> Can you check that the FileSystemType class is actually defined in the >> generated codf.hxx header? >> >> One thing that might be causing this is the name clash with some existing >> function called FileSystemType (possibly defined by one of the system >> headers). You can try to tell the XSD compiler that it is a reserved >> name with the --reserved-name option: >> >> --reserved-name FileSystemType >> >> Better yet, you may want to place the generated code into a namespace >> instead of the global scope. This can be achieved with the --namespace-map >> options: >> >> --namespace-map =codf >> >> Boris >> > > From stargate625 at gmail.com Mon Mar 28 12:27:30 2011 From: stargate625 at gmail.com (William Canton) Date: Mon Mar 28 12:32:59 2011 Subject: [xsd-users] Compiler errors occurred in the generated *.hxx files from CodeSynthesis 3.2 In-Reply-To: References: Message-ID: Oops! I didn't use the correct syntax last time in the --namespace-Map option. I should have used: --namespace-map xml_schema=codf This compiled. However in the end, the same compiler errors kept popping up. On Mon, Mar 28, 2011 at 12:17 PM, William Canton wrote: > > Hi Boris, > > After adding the codf as namespace as you suggested, it created another > problem: CodeSynthesis never generated any headers or cpp files from the > schema. > > William > > > On Mon, Mar 28, 2011 at 12:10 PM, William Canton wrote: > >> The FileSystemType is defined by CodeSynthesis in the same generated >> header codf.hxx on line 5028. There is also a forward declaration of this >> type on line 285 in the same header. >> >> >> On Mon, Mar 28, 2011 at 12:02 PM, Boris Kolpackov < >> boris@codesynthesis.com> wrote: >> >>> Hi William, >>> >>> William Canton writes: >>> >>> > 1>c:\test\generated\codf.hxx(391) : error C2146: syntax error : missing >>> ';' >>> > before identifier 'FileSystem_type' >>> > >>> > [...] >>> > >>> > 391 typedef ::FileSystemType FileSystem_type; >>> >>> Can you check that the FileSystemType class is actually defined in the >>> generated codf.hxx header? >>> >>> One thing that might be causing this is the name clash with some existing >>> function called FileSystemType (possibly defined by one of the system >>> headers). You can try to tell the XSD compiler that it is a reserved >>> name with the --reserved-name option: >>> >>> --reserved-name FileSystemType >>> >>> Better yet, you may want to place the generated code into a namespace >>> instead of the global scope. This can be achieved with the >>> --namespace-map >>> options: >>> >>> --namespace-map =codf >>> >>> Boris >>> >> >> > From boris at codesynthesis.com Mon Mar 28 12:35:28 2011 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Mar 28 12:37:00 2011 Subject: [xsd-users] Compiler errors occurred in the generated *.hxx files from CodeSynthesis 3.2 In-Reply-To: References: Message-ID: Hi William, William Canton writes: > Oops! I didn't use the correct syntax last time in the --namespace-Map > option. I should have used: > > --namespace-map xml_schema=codf I am not so sure. This would be correct if your schema had this in the root element: targetNamespace="xml_schema" Looking at your original code fragment, I don't think you have this. If your schema doesn't have the targetNamespace attribute, then the correct option is: --namespace-map =codf That is, it maps empty namespace (global scope) to codf. If you still cannot figure this out, please send me your schema (off list) and I will take a look. Boris