From Raymond.Rizzuto at sig.com Tue Sep 2 13:31:00 2008 From: Raymond.Rizzuto at sig.com (Rizzuto, Raymond) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] comparison operation In-Reply-To: <20080831101747.GA7719@tpad> References: <20080714201916.GB4395@karelia> <20080828201944.GA24273@tpad> <20080831101747.GA7719@tpad> Message-ID: Thanks for the links. I'll play around with this on the 3.2.0 version, once I can make time on my plate to work with that version. Due to deadlines, I need to forge ahead with the 3.1.1a7 version I've been using. Ray -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Sunday, August 31, 2008 6:18 AM To: Rizzuto, Raymond Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] comparison operation Hi Ray, Rizzuto, Raymond writes: > I can't access the first URL - I get an "Object not found!| Message when > I try. I believe that is the same link as from your 3.2.0 beta1 release > posting, and I did look at that 2 days ago, so maybe it will be back later. Ok, I've removed 2 from www2 in all the places. > I'm hoping I can set the precision to 6 places so that timestamps will > round trip at the microsecond range. On the second thought, perhaps it can work if the numbers you are trying to serialize are also rounded to this precision (that is, the binary representation will have more digits but they will be the same). Another alternative would be to compare string representations. For example, you could defined the Timestamp type in XML Schema by deriving from double. You would then customize this type and provide your own comparison operator implementation which compares two Timestamps as strings with precision 6. This will be slower but will work on all platforms. > I'd be interested in reading the post about VC++ and round-trip for > floats if you can find it. It is this (long) thread on boost-devel: http://lists.boost.org/Archives/boost/2006/03/101988.php The posts of particular interest are: http://lists.boost.org/Archives/boost/2006/04/102744.php http://lists.boost.org/Archives/boost/2006/04/102833.php Boris IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses. From Raymond.Rizzuto at sig.com Thu Sep 4 11:25:10 2008 From: Raymond.Rizzuto at sig.com (Rizzuto, Raymond) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] RE: XSD 3.2.0 beta1 released Message-ID: I just ran a test of the 3.2.0 beta1 (on windows, with xerces 2.8) against my schema, and the output compared identically to the output from 3.1.1a7 (on linux), and they were identical. I did run into some issues configuring the windows version from the zip file: - directory tree differences from 3.1.0 (libxsd vs include) - no xerces o copied the include/xercesc from 3.1 to 3.2's libxsd/xercesc o copied the xerces dll's from 3.1's bin directory to 3.2's bin directory o copied the lib directory from 3.1's tree to same location in 3.2 I'm also again having the issue I reported previously where xsd will rebuild the output files every time I compile. At first I was pointing to the wrong set of rules files, but then I fixed the rules directory path in VC and selected it for the project, and now that is working correctly also. I just wanted to mention these issues for anyone else migrating to the 3.2.0 beta. None of the steps were very hard. Ray ________________________________________ Ray Rizzuto raymond.rizzuto@sig.com Susquehanna International Group (610)747-2336 (W) (215)776-3780 (C) IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses. From boris at codesynthesis.com Thu Sep 4 16:27:53 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] RE: XSD 3.2.0 beta1 released In-Reply-To: References: Message-ID: <20080904202753.GA20110@tpad> Hi Ray, Thanks for the information. My comments are below. Rizzuto, Raymond writes: > - directory tree differences from 3.1.0 (libxsd vs include) > - no xerces > o copied the include/xercesc from 3.1 to 3.2's libxsd/xercesc > o copied the xerces dll's from 3.1's bin directory to 3.2's bin directory > o copied the lib directory from 3.1's tree to same location in 3.2 These differences are due to you using the .msi installer for 3.1.0 while for betas we only provide the .zip package which contains only XSD proper. With the final release we will make both .msi and .zip available. > I'm also again having the issue I reported previously where xsd will > rebuild the output files every time I compile. At first I was pointing > to the wrong set of rules files, but then I fixed the rules directory > path in VC and selected it for the project, and now that is working > correctly also. Just to confirm: once you have pointed VC to the .rules files from the beta, everything started working ok, right? Boris From Raymond.Rizzuto at sig.com Thu Sep 4 16:41:58 2008 From: Raymond.Rizzuto at sig.com (Rizzuto, Raymond) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] RE: XSD 3.2.0 beta1 released In-Reply-To: <20080904202753.GA20110@tpad> References: <20080904202753.GA20110@tpad> Message-ID: Boris, I understand about the .msi including xerces, though I was surprised about the libxsd vs include directory names. To answer your second question, yes, the .rules in the beta work correctly. Ray -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Thursday, September 04, 2008 4:28 PM To: Rizzuto, Raymond Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] RE: XSD 3.2.0 beta1 released Hi Ray, Thanks for the information. My comments are below. Rizzuto, Raymond writes: > - directory tree differences from 3.1.0 (libxsd vs include) > - no xerces > o copied the include/xercesc from 3.1 to 3.2's libxsd/xercesc > o copied the xerces dll's from 3.1's bin directory to 3.2's bin directory > o copied the lib directory from 3.1's tree to same location in 3.2 These differences are due to you using the .msi installer for 3.1.0 while for betas we only provide the .zip package which contains only XSD proper. With the final release we will make both .msi and .zip available. > I'm also again having the issue I reported previously where xsd will > rebuild the output files every time I compile. At first I was pointing > to the wrong set of rules files, but then I fixed the rules directory > path in VC and selected it for the project, and now that is working > correctly also. Just to confirm: once you have pointed VC to the .rules files from the beta, everything started working ok, right? Boris IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses. From boris at codesynthesis.com Thu Sep 4 16:54:31 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] RE: XSD 3.2.0 beta1 released In-Reply-To: References: <20080904202753.GA20110@tpad> Message-ID: <20080904205431.GC20110@tpad> Hi Ray, Rizzuto, Raymond writes: > I understand about the .msi including xerces, though I was surprised > about the libxsd vs include directory names. Historically, .zip (along with other "UNIX" packages) had the XSD runtime in the libxsd directly. In .msi we also package Xerces-C++ and to make setup in VC++ easier we put both XSD and Xerces-C++ include directories in include/. Boris From james at ractive.ch Mon Sep 8 12:11:39 2008 From: james at ractive.ch (Jean-Pierre Bergamin) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] --type-regex looses default regex Message-ID: <48C54EBB.2030207@ractive.ch> Hi xsd-Users If I add the option "--type-regex /(.+)Type/$1/" (to get rid of the "Type" suffix in class names) to the command line of xsd, the generated class names contain the full namespace, i.e. class http___www_example_com_somewhat_SomeName. When having a look at the output with --name-regex-trace, the normally applied regex (?:[^ ]* )?([^,]+) is not applied any more. Shouldn't this be applied anyway? The documentation of type-regex says: "Add to the list of regular expressions", so I'm guessing that my given regex is evaluated after the default one. Am I wrong? Using "--type-regex "/(?:[^ ]* )?([^,]+)Type/$1/"" works as expected. Regards James From boris at codesynthesis.com Tue Sep 9 03:31:55 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] --type-regex looses default regex In-Reply-To: <48C54EBB.2030207@ractive.ch> References: <48C54EBB.2030207@ractive.ch> Message-ID: <20080909073155.GB4243@tpad> Hi James, Jean-Pierre Bergamin writes: > If I add the option "--type-regex /(.+)Type/$1/" (to get rid of the > "Type" suffix in class names) to the command line of xsd, the generated > class names contain the full namespace, i.e. class > http___www_example_com_somewhat_SomeName. When having a look at the > output with --name-regex-trace, the normally applied regex (?:[^ ]* > )?([^,]+) is not applied any more. Shouldn't this be applied anyway? The > documentation of type-regex says: "Add to the list of regular > expressions", so I'm guessing that my given regex is evaluated after the > default one. The regular expressions are added to the list and evaluated until one of them matches. Here is the relevant quote from the "NAMING CONVENTION" section of the XSD Compiler Command Line Manual[1]: "All regular expressions for each category are pushed into a category-specific stack with the last specified expression considered first. The first match that succeeds is used." So what happens in your case is that your expression is evaluated before the built-in ones and since it matches, the result is used without trying any other expressions. Therefore you will need to also match the optional namespace part. [1] http://www.codesynthesis.com/projects/xsd/documentation/xsd.xhtml Boris From jan.klimke at hpi.uni-potsdam.de Tue Sep 9 12:36:45 2008 From: jan.klimke at hpi.uni-potsdam.de (Jan Klimke) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] Specifying Element content for "anyType" Elements Message-ID: <48C6A61D.1020605@hpi.uni-potsdam.de> Hello, after generating the c++/tree classes for GML to use them with a WebFeatureService i ran into problems building request structures which contain anyType'ed elements. An example: I need an instance of the following "PropertyName"-element: There where no methods generated to set the contents of such an element. And a DOM node does not exist when the structure is assambled (to set the elements content there). How can i manage to set the contents ? Another problem i have is the there are not classes genereated for some elements (and their types). Because of classes where only generated for Types i am not able to create an element. Is it possible to force the creation of this kind of element ? Thank you for your help, Jan Klimke From boris at codesynthesis.com Wed Sep 10 05:05:29 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] Specifying Element content for "anyType" Elements In-Reply-To: <48C6A61D.1020605@hpi.uni-potsdam.de> References: <48C6A61D.1020605@hpi.uni-potsdam.de> Message-ID: <20080910090529.GB6428@karelia> Hi Jan, Jan Klimke writes: > I need an instance of the following "PropertyName"-element: > > substitutionGroup="ogc:expression"/> > > > > > > > > > > This fragment uses substitution groups. If you compile your schemas with the --generate-polymorphic option then the generated code will contain support for this and will handle everything automatically. Let's say you have a type which contains the expression element from above: And you want to create an instance of Foo that contains the PropertyName element instead of expression. To achieve this you simply set the expression element to an object of type PropertyNameType (even though its static type is ExpressionType): PropertyNameType& pnt = ... Foo foo (pnt); When you serialize this object the generated code will automatically use the PropertyName element instead of expression. > Another problem i have is the there are not classes genereated for some > elements (and their types). > > substitutionGroup="ogc:logicOps"/> > > > > > > > > > > > > > > As shown above, you don't need to worry about element names when working with substitution groups. Simply use the required type (UnaryLogicOpType in this case) when creating your object model and the generated code will take care of using the right element name during serialization. Boris From karina.abayeva at rbccm.com Wed Sep 10 13:58:51 2008 From: karina.abayeva at rbccm.com (Abayeva, Karina) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] XSD-tree Parsing Question Message-ID: <381066B16350514C8C662EA36DF4B198064BCFDB@SXOM-102.fg.rbc.com> All, I have a question regarding the flag to disable validation. I have a root element that defines several required child elements. Please see the example below for details: When the code is generated, parse function explicitly checks whether Field1_ and Field2_ member variables are present. If they are not, parse function will throw an expected element exception. Is there any way to make these presence checks configurable based on whether I passed in don't_validate flag? The only option that occurs to me is to create a wrapper function in a derived class that will catch expected element exception. Thanks, Karina Abayeva ________________________________________ This E-Mail (including any attachments) may contain privileged or confidential information. It is intended only for the addressee(s) indicated above. The sender does not waive any of its rights, privileges or other protections respecting this information. Any distribution, copying or other use of this E-Mail or the information it contains, by other than an intended recipient, is not sanctioned and is prohibited. If you received this E-Mail in error, please delete it and advise the sender (by return E-Mail or otherwise) immediately. This E-Mail (including any attachments) has been scanned for viruses. It is believed to be free of any virus or other defect that might affect any computer system into which it is received and opened. However, it is the responsibility of the recipient to ensure that it is virus free. The sender accepts no responsibility for any loss or damage arising in any way from its use. E-Mail received by or sent from RBC Capital Markets is subject to review by Supervisory personnel. Such communications are retained and may be produced to regulatory authorities or others with legal rights to the information. IRS CIRCULAR 230 NOTICE: TO COMPLY WITH U.S. TREASURY REGULATIONS, WE ADVISE YOU THAT ANY U.S. FEDERAL TAX ADVISE INCLUDED IN THIS COMMUNICATION IS NOT INTENDED OR WRITTEN TO BE USED, AND CANNOT BE USED, TO AVOID ANY U.S. FEDERAL TAX PENALTIES OR TO PROMOTE, MARKET, OR RECOMMEND TO ANOTHER PARTY ANY TRANSACTION OR MATTER. From gok at aerometric-ak.com Wed Sep 10 20:30:51 2008 From: gok at aerometric-ak.com (Gennady Khokhorin) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] AV exception at getDOMImplementation() call Message-ID: <3054411AF4728548AD6D7137190D56B303DC3C22@admin1.aeromap.com> Hello, All. I'm getting error message dialog box "Unhandled Exception at ... in explorer.exe: 0xc00..5: Access Violation reading 0x0..0" at this call: static const XMLCh m_gLS[] = { chLatin_L, chLatin_S, chNull }; DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(m_gLS); I'm using msvc8.0, MFC. Application is Explorer.exe shell extention (winXP+sp3). Can not figure out what could be wrong. Stand-along xerces examples (DOMCount) are running/debugging fine. Any help, please. Thanks in advance. gok From boris at codesynthesis.com Thu Sep 11 05:39:17 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] AV exception at getDOMImplementation() call In-Reply-To: <3054411AF4728548AD6D7137190D56B303DC3C22@admin1.aeromap.com> References: <3054411AF4728548AD6D7137190D56B303DC3C22@admin1.aeromap.com> Message-ID: <20080911093917.GD9675@karelia> Hi Gennady, Gennady Khokhorin writes: > I'm getting error message dialog box "Unhandled Exception at ... in > explorer.exe: 0xc00..5: Access Violation reading 0x0..0" at this call: > > static const XMLCh m_gLS[] = { chLatin_L, chLatin_S, chNull }; > DOMImplementation *impl = > DOMImplementationRegistry::getDOMImplementation(m_gLS); > > I'm using msvc8.0, MFC. Application is Explorer.exe shell extention > (winXP+sp3). > > Can not figure out what could be wrong. Stand-along xerces examples > (DOMCount) are running/debugging fine. In the majority of case this would point to the uninitialized Xerces-C++ runtime. Can you check if you call xercesc::XMLPlatformUtils::Initialize() before calling getDOMImplementation()? Boris From boris at codesynthesis.com Thu Sep 11 06:30:58 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] XSD-tree Parsing Question In-Reply-To: <381066B16350514C8C662EA36DF4B198064BCFDB@SXOM-102.fg.rbc.com> References: <381066B16350514C8C662EA36DF4B198064BCFDB@SXOM-102.fg.rbc.com> Message-ID: <20080911103058.GE9675@karelia> Hi Karina, Abayeva, Karina writes: > I have a question regarding the flag to disable validation. I have a > root element that defines several required child elements. Please see > the example below for details: > > > > > > > > > When the code is generated, parse function explicitly checks whether > Field1_ and Field2_ member variables are present. If they are not, parse > function will throw an expected element exception. Is there any way to > make these presence checks configurable based on whether I passed in > don't_validate flag? The dont_validate flag controls XML Schema validation in the underlying XML parser. Even when validation is disabled the generated code performs a number of checks to make sure the created object model is valid. Even if there was a way to disable these checks, the resulting object model would most likely be unusable: there would be no way to check whether the required element was set and if you try to access it you will get a segfault. > The only option that occurs to me is to create a wrapper function > in a derived class that will catch expected element exception. Catching the exception won't help much since the parsing won't complete and the object model will be unusable. I see two ways how you can resolve this: 1. If you can modify your schema (even if only for the purpose of code generation) then you can make those elements optional (add maxOccurs="0"). This is the easiest way. 2. The other way would be to customize the generated TestDataType type and perform custom parsing which ignores missing elements. You would probably also want to add a presence flag for each such element so that you can check whether you can access it. For more information on type customization, see the C++/Tree Mapping Customization Guide: http://wiki.codesynthesis.com/Tree/Customization_guide There is also a bunch of examples in the examples/cxx/tree/custom/ directory with the most relevant to your case being 'wildcard'. In your case, however, you will need to completely override the parsing code for this type (based on the wildcard example): data:: data (const xercesc::DOMElement& e, xml_schema::flags f, xml_schema::container* c) : data_base (e, f | xml_schema::flags::base, c) { ... } You can copy the body of this c-tor (as well as parse() function that it will call) from the generated code. In the parse() function you will need to change the checks for missing elements to set a flag instead of throwing an exception. Boris From jan.klimke at hpi.uni-potsdam.de Thu Sep 11 17:02:06 2008 From: jan.klimke at hpi.uni-potsdam.de (Jan Klimke) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] Specifying Element content for "anyType" Elements In-Reply-To: <20080910090529.GB6428@karelia> References: <48C6A61D.1020605@hpi.uni-potsdam.de> <20080910090529.GB6428@karelia> Message-ID: <48C9874E.5060501@hpi.uni-potsdam.de> Hi Boris, thank you for your answer on this issue. It helped a lot until now. But there appeared two further issues with that. First of all the complete schema which is part of my problem: http://schemas.opengis.net/filter/1.1.0/filter.xsd A i have said, i still got some problems: 1. i tried to create an PropertyIsEqualTo element which is defined as follows: I created the object with the following code (in a seperate method): ogc::FilterType filter = ogc::FilterType(); ogc::PropertyNameType& propertyName =(ogc::PropertyNameType&)xml_schema::string("app::isActive"); //Is this correct or how do i have to assign an element value ? Is this kind of upcasting wanted ? ogc::LiteralType& value = (ogc::LiteralType&)xml_schema::string("true"); ogc::BinaryComparisonOpType isEqual = ogc::BinaryComparisonOpType(); ogc::BinaryComparisonOpType::expression_sequence& expressions = ogc::BinaryComparisonOpType::expression_sequence(); expressions.push_back(propertyName); //here i put the instance of propertyName into an expression collection expressions.push_back(value); isEqual.expression(expressions); return filter; When serializing the following XML is generated for the element (appended to a wfs:Query element): app::isActive true As you can see, the generated element is not the desired one but "PropertyIsGreaterThanOrEqualTo". This element is defined like the PropertyIsEqualTo element: Because they are both of the same type no other class as ogc:BinaryComparisonOpType is generated. And also the instance of PropertyNameType and LiteralType where not serialized as the elements i wanted. Where is my fault ? 2. The other issue i found was assigning boolean values as a LiteralType instance. The does not work because xml_schema::boolean does not derrive from xml_schema::type. Is there something like a wrapper for that ? Greetings, Jan Boris Kolpackov schrieb: > Hi Jan, > > Jan Klimke writes: > > >> I need an instance of the following "PropertyName"-element: >> >> > substitutionGroup="ogc:expression"/> >> >> >> >> >> >> >> >> >> >> >> > > This fragment uses substitution groups. If you compile your schemas > with the --generate-polymorphic option then the generated code will > contain support for this and will handle everything automatically. > > Let's say you have a type which contains the expression element from > above: > > > > > > > > And you want to create an instance of Foo that contains the PropertyName > element instead of expression. To achieve this you simply set the > expression element to an object of type PropertyNameType (even though > its static type is ExpressionType): > > PropertyNameType& pnt = ... > > Foo foo (pnt); > > When you serialize this object the generated code will automatically > use the PropertyName element instead of expression. > > > >> Another problem i have is the there are not classes genereated for some >> elements (and their types). >> >> > substitutionGroup="ogc:logicOps"/> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > > As shown above, you don't need to worry about element names when > working with substitution groups. Simply use the required type > (UnaryLogicOpType in this case) when creating your object model > and the generated code will take care of using the right element > name during serialization. > > Boris > From gok at aerometric-ak.com Thu Sep 11 20:19:48 2008 From: gok at aerometric-ak.com (Gennady Khokhorin) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] FW: no reaction on XSD_CXX_TREE_DECIMAL_PRECISION Message-ID: <3054411AF4728548AD6D7137190D56B303DC3CF3@admin1.aeromap.com> (forwarded from xsde-users forum) Hello, List. I'm getting c++ doubles on serialization input: 65.043000 output: 65.043000000000006 Macros, fstream have no effect on results: #define XSD_CXX_TREE_FLOAT_PRECISION 3 #define XSD_CXX_TREE_DOUBLE_PRECISION 3 #define XSD_CXX_TREE_DECIMAL_PRECISION 3 ofs.precision(3); What I'm doing wrong? Could somebody help to restrict decimals? Msvc8.0 + xsd3.1.0 Gennady From boris at codesynthesis.com Fri Sep 12 04:21:13 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] Specifying Element content for "anyType" Elements In-Reply-To: <48C9874E.5060501@hpi.uni-potsdam.de> References: <48C6A61D.1020605@hpi.uni-potsdam.de> <20080910090529.GB6428@karelia> <48C9874E.5060501@hpi.uni-potsdam.de> Message-ID: <20080912082113.GA13410@karelia> Hi Jan, Jan Klimke writes: > i tried to create an PropertyIsEqualTo element which is defined as follows: > > type="ogc:BinaryComparisonOpType" > substitutionGroup="ogc:comparisonOps"/> > > [...] > > As you can see, the generated element is not the desired one but > "PropertyIsGreaterThanOrEqualTo". > > This element is defined like the PropertyIsEqualTo element: > > type="ogc:BinaryComparisonOpType" substitutionGroup="ogc:comparisonOps"/> > > Because they are both of the same type no other class as > ogc:BinaryComparisonOpType is generated. It looks like this schema is using element names as some sort of identifiers even though they are all of the same type. This does not work very well with XSD's automatic handling of substitution groups since the generated code uses the first element name that matches the type. I see two ways how you can resolve this: 1. You can change the schema to an equivalent one but which assigns different types to different operation elements. This schema will be equivalent to the original in the sense that it will define the same XML vocabulary: And so on for all the elements that substitute comparisonOps and are of the BinaryComparisonOpType type. 2. The second method is quite a bit more involved but does not require any schema modifications. With this method you will need to customize all the types that contain the comparisonOps element (e.g., FilterType). Your customization will need to do two things: a) Add a mechanism for specifying which element name should be used. This can be a modifier function that passes element name as a string. b) Customize the serialization operator to change the name of the DOM element. For more information on type customization, see the C++/Tree Mapping Customization Guide: http://wiki.codesynthesis.com/Tree/Customization_guide There is also a bunch of examples in the examples/cxx/tree/custom/ directory with the most relevant to your case being 'wildcard'. Here is an outline of the FilterType implementation. In your case you don't need to customize parsing so we just call the base implementation (or you can change it to extract the operation name from DOM): class FilterType: public FilterTypeBase { public: void comparisonOpName (const std::string& name) { comparisonOpName_ = name; } const std::string& comparisonOpName () const { return comparisonOpName_; } // Parsing constructor. Just call our base. // FilterType (const xercesc::DOMElement& e, xml_schema::flags = 0, xml_schema::container* = 0) : data_base (e, f, c) { } ... private: std::string comparisonOpName_; }; // Serialization operator. // void operator<< (xercesc::DOMElement&, const FilterType& f) { // Use our base to serialize data and id. // const FilterTypeBase& fb (f); e << fb; if (f.comparisonOps ().present ()) { // Change the name of the child element of 'e' to the one // returned by f.comparisonOpName (). Use the renameNode() // function on DOMDocument. } } When you use this type in your code you will need to set the actual name of the comparisonOps element manually. > And also the instance of PropertyNameType and LiteralType where not > serialized as the elements i wanted. It is hard to answer this without knowing what you actually wanted ;-). > The other issue i found was assigning boolean values as a LiteralType > instance. The does not work because xml_schema::boolean does not > derrive from xml_schema::type. That's right. Types that are mapped to fundamental C++ types cannot be used for dynamic typing. What you can do is add a type that derives from the boolean XML Schema type: Then you can use this type since it will be derived from xml_schema::type. Boris From boris at codesynthesis.com Fri Sep 12 04:32:50 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] no reaction on XSD_CXX_TREE_DECIMAL_PRECISION In-Reply-To: <3054411AF4728548AD6D7137190D56B303DC3CF3@admin1.aeromap.com> References: <3054411AF4728548AD6D7137190D56B303DC3CF3@admin1.aeromap.com> Message-ID: <20080912083250.GB13410@karelia> Hi Gennady, Gennady Khokhorin writes: > input: 65.043000 > output: 65.043000000000006 > > Macros, fstream have no effect on results: > #define XSD_CXX_TREE_FLOAT_PRECISION 3 > #define XSD_CXX_TREE_DOUBLE_PRECISION 3 > #define XSD_CXX_TREE_DECIMAL_PRECISION 3 > ofs.precision(3); > > [...] > > Msvc8.0 + xsd3.1.0 These macros are only available since XSD 3.2.0. There is a beta available for 3.2.0 and the final release is coming soon (2-3 weeks): http://www.codesynthesis.com/pipermail/xsd-users/2008-August/001897.html Also note that you cannot #define these macros in a file. You need to specify them in the C++ compiler command line: -DXSD_CXX_TREE_FLOAT_PRECISION=3 If you need to stick to 3.1.0 then the only way to achieve what you want is to customize parsing and serialization code for the double type. This is shown in the following example: http://www.codesynthesis.com/~boris/tmp/custom-double.zip Boris From Raymond.Rizzuto at sig.com Fri Sep 12 12:15:03 2008 From: Raymond.Rizzuto at sig.com (Rizzuto, Raymond) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] no reaction on XSD_CXX_TREE_DECIMAL_PRECISION In-Reply-To: <20080912083250.GB13410@karelia> References: <3054411AF4728548AD6D7137190D56B303DC3CF3@admin1.aeromap.com> <20080912083250.GB13410@karelia> Message-ID: I'm also going to need to use these macros. I am currently getting these results w/3.1: Input: 25.99000000 Output: 25.989999999999998 I am hoping to get this with 3.2, assuming I use the macro's to limit to a precision of 8: Input: 25.99000000 Output: 25.99000000 One thing, however, that I don't like about the macros is that they apply globally. I would really like to be able to specify the precision dynamically based on the input precision I read in. I.e., if I read in 25.99 as a string, and note that there are 2 digits of precision, I would want to somehow specify that detail for the XML double that I create from it. Also, I recall seeing an earlier posting where a small float, say 0.357E-30 is truncated to 0 on output. I think the issue here is the way precision is defined. I would prefer something more akin to the engineering definition of significant digits. I.e. 0.357E-30 has 3 significant digits. If I request the precision to be 2 digits, then I'd expect 0.36E-30 on output. Ray -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Friday, September 12, 2008 4:33 AM To: Gennady Khokhorin Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] no reaction on XSD_CXX_TREE_DECIMAL_PRECISION Hi Gennady, Gennady Khokhorin writes: > input: 65.043000 > output: 65.043000000000006 > > Macros, fstream have no effect on results: > #define XSD_CXX_TREE_FLOAT_PRECISION 3 > #define XSD_CXX_TREE_DOUBLE_PRECISION 3 > #define XSD_CXX_TREE_DECIMAL_PRECISION 3 > ofs.precision(3); > > [...] > > Msvc8.0 + xsd3.1.0 These macros are only available since XSD 3.2.0. There is a beta available for 3.2.0 and the final release is coming soon (2-3 weeks): http://www.codesynthesis.com/pipermail/xsd-users/2008-August/001897.html Also note that you cannot #define these macros in a file. You need to specify them in the C++ compiler command line: -DXSD_CXX_TREE_FLOAT_PRECISION=3 If you need to stick to 3.1.0 then the only way to achieve what you want is to customize parsing and serialization code for the double type. This is shown in the following example: http://www.codesynthesis.com/~boris/tmp/custom-double.zip Boris IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses. From cll at rincon.com Fri Sep 12 18:56:03 2008 From: cll at rincon.com (cll) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] C++ to XML Message-ID: <058e01c9152a$bba285d0$73c909c2@rinconres.com> XSD seems to take XML->C++. Does anybody have any recommendations for X++->XML? I have to interface with my user in XML and was hoping for a product that could generate C++ classes that "go both ways" based on a provided schema. Thanks, CN From boris at codesynthesis.com Mon Sep 15 03:01:31 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] C++ to XML In-Reply-To: <058e01c9152a$bba285d0$73c909c2@rinconres.com> References: <058e01c9152a$bba285d0$73c909c2@rinconres.com> Message-ID: <20080915070131.GA22047@karelia> Hi, cll writes: > XSD seems to take XML->C++. Does anybody have any recommendations for > X++->XML? I have to interface with my user in XML and was hoping for a > product that could generate C++ classes that "go both ways" based on a > provided schema. XSD's C++/Tree mapping generates C++ classes along with parsing (XML to C++ objects) and serialization (C++ objects to XML) code. Serialization is optional and you need to request it with the --generate-serialization option. For more information see the 'library' example in the examples/cxx/tree/ directory as well as Section 2, "Hello World Example" and Section 6, "Serialization" in the C++/Tree Mapping Getting Started Guide: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/ Boris From boris at codesynthesis.com Mon Sep 15 03:21:13 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] no reaction on XSD_CXX_TREE_DECIMAL_PRECISION In-Reply-To: References: <3054411AF4728548AD6D7137190D56B303DC3CF3@admin1.aeromap.com> <20080912083250.GB13410@karelia> Message-ID: <20080915072113.GB22047@karelia> Hi Ray, Rizzuto, Raymond writes: > One thing, however, that I don't like about the macros is that they > apply globally. I would really like to be able to specify the > precision dynamically based on the input precision I read in. > I.e., if I read in 25.99 as a string, and note that there are > 2 digits of precision, I would want to somehow specify that > detail for the XML double that I create from it. You can do this with type customization. That is, you would define a type in XML Schema that derives from the built-in double type. You can then customize it in the generated code and override it's parsing and serialization code to implement this logic (you will also probably want to allow the user to specify precision manually in case an instance of this type is not read from XML). In case the precision for your type is fixed then there is even an easier method which is supported in 3.2.0. You can use the fractionDigits XML Schema facet which will then be honored during serialization: > Also, I recall seeing an earlier posting where a small float, > say 0.357E-30 is truncated to 0 on output. This will happen if the format is set to fixed and the precision is not enough to represent this value. In 3.2.0 float and double are saved in the automatic mode (fixed or scientific representation if automatically selected depending on which one is more efficient) so this rounding won't happen. The decimal type, on the other hand, is always in the fixed format per the spec. > I think the issue here is the way precision is defined. I would prefer > somethin more akin to the engineering definition of significant digits. > I.e. 0.357E-30 has 3 significant digits. If I request the precision to > be 2 digits, then I'd expect 0.36E-30 on output. That's exactly what you will get if you set the precision to 2: #include using namespace std; int main () { double d = 0.357E-30; cerr << d << endl; cerr.precision (2); cerr << d << endl; } Output: 3.57e-31 3.6e-31 Boris From Raymond.Rizzuto at sig.com Mon Sep 15 07:50:12 2008 From: Raymond.Rizzuto at sig.com (Rizzuto, Raymond) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] no reaction on XSD_CXX_TREE_DECIMAL_PRECISION In-Reply-To: <20080915072113.GB22047@karelia> References: <3054411AF4728548AD6D7137190D56B303DC3CF3@admin1.aeromap.com> <20080912083250.GB13410@karelia> , <20080915072113.GB22047@karelia> Message-ID: Boris, Thanks for the suggestions. Let me see if I understand. Let's say I have a message with two instances of the type (for example, a type of temperature, one instance for internal, one for external). Each of the two temperatures might have different precision, maybe based on the accuracy of the respective temperature sensor. If I understand you, my overridden type (for temperature) would need an accessor function to allow setting the precision, and the serialization logic would use the precision attribute. I asked the author of the schema about specifying fractionDigits in the schema, but he was not in favor of that idea. I know I could create a modified version of his schema, but that would be a maintenance nightmare since the schema has been in flux. The flux has been bad enough. Ray ________________________________________ From: Boris Kolpackov [boris@codesynthesis.com] Sent: Monday, September 15, 2008 3:21 AM To: Rizzuto, Raymond Cc: Gennady Khokhorin; xsd-users@codesynthesis.com Subject: Re: [xsd-users] no reaction on XSD_CXX_TREE_DECIMAL_PRECISION Hi Ray, Rizzuto, Raymond writes: > One thing, however, that I don't like about the macros is that they > apply globally. I would really like to be able to specify the > precision dynamically based on the input precision I read in. > I.e., if I read in 25.99 as a string, and note that there are > 2 digits of precision, I would want to somehow specify that > detail for the XML double that I create from it. You can do this with type customization. That is, you would define a type in XML Schema that derives from the built-in double type. You can then customize it in the generated code and override it's parsing and serialization code to implement this logic (you will also probably want to allow the user to specify precision manually in case an instance of this type is not read from XML). In case the precision for your type is fixed then there is even an easier method which is supported in 3.2.0. You can use the fractionDigits XML Schema facet which will then be honored during serialization: > Also, I recall seeing an earlier posting where a small float, > say 0.357E-30 is truncated to 0 on output. This will happen if the format is set to fixed and the precision is not enough to represent this value. In 3.2.0 float and double are saved in the automatic mode (fixed or scientific representation if automatically selected depending on which one is more efficient) so this rounding won't happen. The decimal type, on the other hand, is always in the fixed format per the spec. > I think the issue here is the way precision is defined. I would prefer > somethin more akin to the engineering definition of significant digits. > I.e. 0.357E-30 has 3 significant digits. If I request the precision to > be 2 digits, then I'd expect 0.36E-30 on output. That's exactly what you will get if you set the precision to 2: #include using namespace std; int main () { double d = 0.357E-30; cerr << d << endl; cerr.precision (2); cerr << d << endl; } Output: 3.57e-31 3.6e-31 Boris IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses. From michal_widera at poczta.onet.pl Mon Sep 15 05:20:21 2008 From: michal_widera at poczta.onet.pl (Michal Widera) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] G2S protocol with confilicting type Message-ID: Dear XSD-Users and CodeSynthesis, I'm try to use XSD on G2S protocol. Protocol is coded as xsd set and is free available on Gaming Standards website: http://www.gamingstandards.com/pdfs/standards/G2S_v1.0.3.zip (in this zip there is a full schema with set of xsd) Unfortunately i get some errors after issuing following command: xsd cxx-tree --root-element g2sMessage --type-naming ucc g2sMessage.xsd g2sGamePlay.xsd:59:67: error: attribute name 'p_wagerCategory/maxWagerCredits' creates an unstable conflict when used as a type name g2sCabinet.xsd:138:19: info: conflicting type is defined here g2sGamePlay.xsd:59:67: info: use --anonymous-regex to resolve this conflict g2sGamePlay.xsd:59:67: info: and don't forget to pass the same option when translating 'g2sGamePlay.xsd' and all the schemas that refer to it ... ... ... g2sCentral.xsd:79:66: error: attribute name 'p_centralProfile/minLogEntries' creates an unstable conflict when used as a type name g2sGamePlay.xsd:80:19: info: conflicting type is defined here g2sCentral.xsd:79:66: info: use --anonymous-regex to resolve this conflict g2sCentral.xsd:79:66: info: and don't forget to pass the same option when translating 'g2sCentral.xsd' and all the schemas that refer to it I was trying to use following annonymous-regex xsd cxx-tree --root-element g2sMessage --type-naming ucc --anonymous-regex '#.* (.+)/(.+)#$1_$2#' g2sMessage.xsd But this fail also. Is there any way to resolve this problem? Best Regards, Michal Widera From boris at codesynthesis.com Mon Sep 15 08:28:38 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] G2S protocol with confilicting type In-Reply-To: References: Message-ID: <20080915122838.GI22047@karelia> Hi Michal, Michal Widera writes: > I'm try to use XSD on G2S protocol. > Protocol is coded as xsd set and is free available on Gaming Standards website: > http://www.gamingstandards.com/pdfs/standards/G2S_v1.0.3.zip > (in this zip there is a full schema with set of xsd) > > Unfortunately i get some errors after issuing following command: > xsd cxx-tree --root-element g2sMessage --type-naming ucc g2sMessage.xsd G2S is a peculiar schema. It contains files that are not self-sufficient and cannot be compiled independently. That is, when you load them via g2sMessage.xsd, they are valid but by themselves they don't contain the necessary include's/import's for declarations that they use. Because of this you need to use the file-per-type compilation mode. For more information about this mode see the following blog post: http://www.codesynthesis.com/~boris/blog/2008/02/13/codesynthesis-xsd-3-1-0-released/ We also happened to have a GNU make-based test for this schema which I uploaded here if you are interested: http://www.codesynthesis.com/~boris/tmp/g2s-test.tar.gz The test builds a simple test driver that loads and prints a G2S document. A few notes on the test: 1. You need to place the G2S schemas into the same directory as the Makefile. 2. You may need to adjust the paths to the XSD compiler and runtime library at the beginning of the Makefile. 3. If you have several CPUs/Cores, consider using the -j GNU make option -- the schema is quite big and it takes some time to compile. Boris From boris at codesynthesis.com Mon Sep 15 08:35:52 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] no reaction on XSD_CXX_TREE_DECIMAL_PRECISION In-Reply-To: References: <3054411AF4728548AD6D7137190D56B303DC3CF3@admin1.aeromap.com> <20080912083250.GB13410@karelia> Message-ID: <20080915123552.GJ22047@karelia> Hi Ray, Rizzuto, Raymond writes: > Let's say I have a message with two instances of the type (for example, > a type of temperature, one instance for internal, one for external). > Each of the two temperatures might have different precision, maybe > based on the accuracy of the respective temperature sensor. If I > understand you, my overridden type (for temperature) would need > an accessor function to allow setting the precision, and the > serialization logic would use the precision attribute. Yes, you can certainly implement it this way. Furthermore, the parsing logic can try to figure out the precision automatically based, for example, on the number of characters after '.' in the string representation. > I asked the author of the schema about specifying fractionDigits > in the schema, but he was not in favor of that idea. I know I > could create a modified version of his schema, but that would > be a maintenance nightmare since the schema has been in flux. Then you can use type customization to implement the fractionDigits behavior without having it in the schema. The custom/double example in 3.2.0 shows how to do something similar for the build-in double type though you would probably want to customize a user-defined type (e.g., temperature) which is even easier. Boris From sneeraj2 at yahoo.com Wed Sep 17 00:30:54 2008 From: sneeraj2 at yahoo.com (Neeraj Seshadri) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] XSD support for WinCE (ARM) Message-ID: <420327.80156.qm@web31901.mail.mud.yahoo.com> Hi, I would like to know if the CodeSynthesis XSD is supported for WinCE (ARM) platform. I noticed that XSDE is specifically meant for embedded systems. However XSDE does not seem to support in-memory tree kinda parser and this is supported by XSD. Is it possible to build XSD for WinCE. Alternately is there a way to use XSDE with WinCE for in-memory tree parsing of XML. Thanks Neeraj From boris at codesynthesis.com Wed Sep 17 06:13:55 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] XSD support for WinCE (ARM) In-Reply-To: <420327.80156.qm@web31901.mail.mud.yahoo.com> References: <420327.80156.qm@web31901.mail.mud.yahoo.com> Message-ID: <20080917101355.GA19700@karelia> Hi Neeraj, Neeraj Seshadri writes: > I would like to know if the CodeSynthesis XSD is > supported for WinCE (ARM) platform. XSD is not really targeted at embedded systems though it might be possible to use if you have a fairly complete C++ standard library and modern enough compiler (eVC++ 4.0 definitely won't work). Which version of WinCE and VC++ are you using? > Alternately is there a way to use XSDE with WinCE for > in-memory tree parsing of XML. We are working on a light-wight C++/Tree-like mapping for XSD/e which should be available in the next two months (perhaps even earlier for beta testing). This will probably be the best option if you can wait a bit. Boris From akramsaye at yahoo.se Wed Sep 17 08:05:18 2008 From: akramsaye at yahoo.se (Akram Saye) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] =?utf-8?q?=E2=80=9Cerror=3A_Not_valid_after_content?= =?utf-8?b?4oCd?= Message-ID: <423808.70125.qm@web25508.mail.ukl.yahoo.com> I get the message ?error: Not valid after content? After I pars my message to xml. I can write to you a bit of the code for parsing. const xml_schema::flags validate(0); ??????? ::xml_schema::properties schema; ??????????? ??????????? schema.no_namespace_schema_location ("test.xsd"); ?????? ??????? auto_ptr message; ??????? try ??????? { ????????? ACE_DEBUG ((LM_DEBUG, ACE_TEXT("(%t) Myconnector:: about to parse: \n%s\n"), r_strMsg.str().c_str() )); ????????? message = Skiva_(r_strMsg, validate, schema); ??????? } ??????????? ??????????? atch (const xml_schema::exception& e) ??????? { ????????? ACE_DEBUG ((LM_DEBUG, ACE_TEXT("(%t) Myconnector:: handle_input(): %s\n"),? boost::lexical_cast(e).c_str() )); ??????????? ??????????? ? bReturn = false; ??????????? ??????????? } ??????????? ??????????? ??????????? ??????????? I get the message ??????????? ??????????? Myconnector:: about to parse: ? ? ??? 2006-08-15T04:04:04 ??? 16444 ??? E??? ? ? Myconnector:: handle_input(): :17:7 error: Not valid after content could you please help me with this.? Regards Tanha __________________________________________________________ L?na pengar utan s?kerhet. J?mf?r vilkor online hos Kelkoo. http://www.kelkoo.se/c-100390123-lan-utan-sakerhet.html?partnerId=96915014 From boris at codesynthesis.com Wed Sep 17 09:38:42 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] error: Not valid after content In-Reply-To: <423808.70125.qm@web25508.mail.ukl.yahoo.com> References: <423808.70125.qm@web25508.mail.ukl.yahoo.com> Message-ID: <20080917133842.GD18097@karelia> Hi, Akram Saye writes: > Myconnector:: about to parse: > > xsi:noNamespaceSchemaLocation="../xml/test.xsd"> > > ? > > ? > > > ??? 2006-08-15T04:04:04 > > ??? 16444 > > ??? E??? > > ? > > ? > > > > > > Myconnector:: handle_input(): :17:7 error: Not valid after content The XML you are trying to parse is invalid. It contains XML declaration (" Could we add milliseconds to date_time type, to compline xsd:dateTime demands ? Thank you andrej ________________________________________________________ ?? ??? ? Yahoo!? ????????? ??????????? ? ??????????. Yahoo! ?????! http://ru.mail.yahoo.com From boris at codesynthesis.com Wed Sep 17 09:47:45 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] milliseconds in date_time In-Reply-To: <778003.5183.qm@web65404.mail.ac4.yahoo.com> References: <778003.5183.qm@web65404.mail.ac4.yahoo.com> Message-ID: <20080917134745.GE18097@karelia> Hi Andrej, Andrej Barkhatov writes: > Could we add milliseconds to date_time type, to compline xsd:dateTime > demands ? The date_time type represent the seconds component as double which allows you to represent milliseconds in the fractional part. Boris From dsuhpublic at gmail.com Wed Sep 17 20:01:12 2008 From: dsuhpublic at gmail.com (D. S.) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] Problems Accessing Object Message-ID: I am evaluating your product for our company and I just can get to the objects. Make complains I am using request as a method but all other iterations I have tried fails. How do I access the optional part? (the examples do not match this .xsd) My test driver app: auto_ptr msc (MediaServerControl(argv[1])); MediaServerControl::request_optional& reqo (msc->request()); root element in .xsd: From boris at codesynthesis.com Thu Sep 18 12:13:56 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] Problems Accessing Object In-Reply-To: References: Message-ID: <20080918161356.GF7483@karelia> Hi, D. S. writes: > My test driver app: > auto_ptr msc (MediaServerControl(argv[1])); > MediaServerControl::request_optional& reqo (msc->request()); > > root element in .xsd: > > > > > > [...] What happens here is the following: MediaServerControl is a global element with anonymous type inside. When the XSD compiler translates this to C++ it automatically assigns a name to the anonymous type which is derived from the outer element name. So we end up with both the type and global element being called MediaServerControl. Since it is inconvenient in C++ to have both a class and a function with the same name in the same scope, the XSD compiler renames (escapes) the parsing function name in this case by appending '_' to it (this is explained in more detail in Section 2.1.1, "Identifiers" in the C++/Tree Mapping User Manual[1]). Based on this insight we can change your code like so (note the underscore in the parsing function call): auto_ptr msc (MediaServerControl_(argv[1])); MediaServerControl::request_optional& reqo (msc->request()); if (reqo.present ()) { request& r = reqo.get (); ... } You can also alter the way XSD derives names for anonymous types. For example, you can append "Type" to every such name. For more information on how to do this see the documentation for the --anonymous-regex command line option in the XSD Compiler Command Line Manual[2]. [1] http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.1.1 [2] http://www.codesynthesis.com/projects/xsd/documentation/xsd.xhtml Boris From eric at boostpro.com Thu Sep 18 12:57:38 2008 From: eric at boostpro.com (Eric Niebler) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] polymorphism across dlls broken Message-ID: <48D28882.30008@boostpro.com> I'm evaluating XSD 3.1 for use in a project, and first let me say that I've been very impressed so far. Nice work. I have run into a problem with the support for polymorphism in the presence of multiple dlls. (I'm using the C++/tree mapping.) In my use case, I have an application consisting of multiple dlls, each with its own XML schema. A complexType in one dll's schema may be an xsd:extension of a complexType in another dll's schema. XSD generates the correct C++ inheritance hierarchy in this case (and the correct header includes and dllexport/imports, etc.), but when trying to serialize these types to XML, I get xsd::cxx::tree::no_type_info exception. When all the types are in the same executable, everything works fine. The problem, as far as I can tell, seems to be the xsd::cxx::tree::type_serializer_map_instance() function in type-serializer-map.hxx. It looks like this: template inline type_serializer_map& type_serializer_map_instance () { return *type_serializer_plate::map; } ... where type_serializer_plate looks like ... template struct type_serializer_plate { static type_serializer_map* map; /* ... */ }; This is clearly not going to work in the presence of multiple dlls. Each dll will get its own type_serializer_map, in which the types that live in that dll -- and only those types -- are registered. Attempts to look up types from other dlls will fail, and the type_serializer_map::serialize() function will throw a no_type_info exception. Is this a known problem? I can build a simple repro of the problem if that's necessary. The solution, it seems, would be to move the definition of the type_serializer_map object into a separate dll, so that all dlls can share the instance. Or something clever where each type_serializer_map::type_info object holds a pointer back to the type_serializer_map instance with which it's registered, so that type look-ups can chase pointers into the type_serializer_maps of other dlls. -- Eric Niebler BoostPro Computing http://www.boostpro.com From dsuhpublic at gmail.com Thu Sep 18 14:39:44 2008 From: dsuhpublic at gmail.com (D. S.) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] Problems Accessing Object In-Reply-To: <20080918161356.GF7483@karelia> References: <20080918161356.GF7483@karelia> Message-ID: Boris, I got the code to compile with your change, but the parser fails ("error : Unknown element 'MediaServerControl'" and many others) with an input xml file if I don't have xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hello.xsd Is there a setting or change I can make to use just ? The thing is that XSD/e accepts the .xsd and .xml file as it is and parses and prints out the elements. On Thu, Sep 18, 2008 at 9:13 AM, Boris Kolpackov wrote: > > Hi, > > D. S. writes: > > > My test driver app: > > auto_ptr msc (MediaServerControl(argv[1])); > > MediaServerControl::request_optional& reqo (msc->request()); > > > > root element in .xsd: > > > > > > > > > > > > [...] > > What happens here is the following: MediaServerControl is a global > element with anonymous type inside. When the XSD compiler translates > this to C++ it automatically assigns a name to the anonymous type > which is derived from the outer element name. So we end up with > both the type and global element being called MediaServerControl. > Since it is inconvenient in C++ to have both a class and a function > with the same name in the same scope, the XSD compiler renames > (escapes) the parsing function name in this case by appending '_' > to it (this is explained in more detail in Section 2.1.1, > "Identifiers" in the C++/Tree Mapping User Manual[1]). > > Based on this insight we can change your code like so (note the > underscore in the parsing function call): > > auto_ptr msc (MediaServerControl_(argv[1])); > MediaServerControl::request_optional& reqo (msc->request()); > > if (reqo.present ()) > { > request& r = reqo.get (); > > ... > } > > You can also alter the way XSD derives names for anonymous types. > For example, you can append "Type" to every such name. For more > information on how to do this see the documentation for the > --anonymous-regex command line option in the XSD Compiler Command > Line Manual[2]. > > [1] http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.1.1 > > [2] http://www.codesynthesis.com/projects/xsd/documentation/xsd.xhtml > > Boris From mburnham at gblsys.com Thu Sep 18 14:29:10 2008 From: mburnham at gblsys.com (Matt Burnham) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] Different C++ namespace for included schema Message-ID: <48D29DF6.9050807@gblsys.com> I've looked through the archives and can't find an answer for what I'm trying to do. I have 2 schemas (attached with command lines) and I want to specify different C++ namespaces (foo & bar) using the --namespace-map option. The second schema includes the first one and uses an element (type1) from the first one. When I compile the resulting C++ code I get the error that 'type1' is not a member of 'bar' since type1 is in the namespace 'foo'. Is there anyway to do this other than using the same namespace for both schemas (which I'd really rather not do)? Thanks, Matt Schema 1: (compiled using xsd.exe cxx-tree --root-element type1 --namespace-map =foo test1.xsd) Schema 2: (compiled using xsd.exe cxx-tree --root-element type2 --namespace-map =bar test2.xsd) From boris at codesynthesis.com Thu Sep 18 16:48:01 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] Problems Accessing Object In-Reply-To: References: <20080918161356.GF7483@karelia> Message-ID: <20080918204801.GA9293@karelia> Hi, D. S. writes: > I got the code to compile with your change, but the parser fails > ("error : Unknown element 'MediaServerControl'" and many others) with > an input xml file if I don't have > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:noNamespaceSchemaLocation="hello.xsd > Is there a setting or change I can make to use just > ? Yes, there are several methods to supply this information as discussed in Section 5.1, "XML Schema Validation and Searching" in the C++/Tree Mapping Getting Started Guide: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#5.1 > The thing is that XSD/e accepts the .xsd and .xml file as it is and > parses and prints out the elements. Mappings in XSD/e perform XML Schema validation in the generated code. The C++/Tree mapping in XSD uses the underlying XML parser (Xerces-C++) for XML Schema validation. Boris From boris at codesynthesis.com Thu Sep 18 17:05:12 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] polymorphism across dlls broken In-Reply-To: <48D28882.30008@boostpro.com> References: <48D28882.30008@boostpro.com> Message-ID: <20080918210512.GC9293@karelia> Hi Eric, Eric Niebler writes: > Is this a known problem? Your analysis of the problem is quite correct, well done. Yes, it is a know problem. It was reported a couple of months ago by Matthew Hutchins. Here is the thread in the archives: http://www.codesynthesis.com/pipermail/xsd-users/2008-June/001763.html > The solution, it seems, would be to move the definition of the > type_serializer_map object into a separate dll, so that all dlls > can share the instance. In the upcoming 3.2.0 release (should be out in a few weeks) we have implemented support for exactly this. You can try it out in the beta: http://www.codesynthesis.com/pipermail/xsd-announcements/2008/000029.html Once you get the archive, look for the --export-maps and --import-maps options in documentation/xsd.xhtml. In a nutshell, you will need to compile schemas that go to your "root" DLL with the --export-maps. And schemas for all other DLLs and the executable with --import-maps. Boris From boris at codesynthesis.com Thu Sep 18 17:10:16 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] Different C++ namespace for included schema In-Reply-To: <48D29DF6.9050807@gblsys.com> References: <48D29DF6.9050807@gblsys.com> Message-ID: <20080918211016.GD9293@karelia> Hi Matt, Matt Burnham writes: > I have 2 schemas (attached with command lines) and I want to specify > different C++ namespaces (foo & bar) using the --namespace-map option. If the two schemas have the same XML Schema namespace (no namespace in your case) and one includes the other then you will have to use the same C++ namespace for both. The only way to achieve what you want would be to put the two schemas into different XML Schema namespaces and use import instead of include. Boris From dsuhpublic at gmail.com Thu Sep 18 17:21:46 2008 From: dsuhpublic at gmail.com (D. S.) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] Problems Accessing Object In-Reply-To: <20080918204801.GA9293@karelia> References: <20080918161356.GF7483@karelia> <20080918204801.GA9293@karelia> Message-ID: Boris, Thank you for your help. The only thing is the example you gave does not exactly work in my case. I had to modify it to the following: if (reqo.present ()) { MediaServerControl::request_type& r = reqo.get (); ... } On Thu, Sep 18, 2008 at 1:48 PM, Boris Kolpackov wrote: > Hi, > > D. S. writes: > >> I got the code to compile with your change, but the parser fails >> ("error : Unknown element 'MediaServerControl'" and many others) with >> an input xml file if I don't have >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> xsi:noNamespaceSchemaLocation="hello.xsd >> Is there a setting or change I can make to use just >> ? > > Yes, there are several methods to supply this information as discussed > in Section 5.1, "XML Schema Validation and Searching" in the C++/Tree > Mapping Getting Started Guide: > > http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#5.1 > > >> The thing is that XSD/e accepts the .xsd and .xml file as it is and >> parses and prints out the elements. > > Mappings in XSD/e perform XML Schema validation in the generated code. > The C++/Tree mapping in XSD uses the underlying XML parser (Xerces-C++) > for XML Schema validation. > > Boris > From boris at codesynthesis.com Thu Sep 18 18:21:11 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] Problems Accessing Object In-Reply-To: References: <20080918161356.GF7483@karelia> <20080918204801.GA9293@karelia> Message-ID: <20080918222111.GG9293@karelia> Hi, D. S. writes: > The only thing is the example you gave does not exactly work in my case. > I had to modify it to the following: > > if (reqo.present ()) > { > MediaServerControl::request_type& r = reqo.get (); > > ... > } Yes, this could be the case. I was guessing the name of the C++ class that will be generated for the inner anonymous type (request) based on the schema fragment you have shown. There could be another type with this name (or another anonymous type that had the same derived name) before the MediaServerControl declaration. In this case the name of the type will be something other than request (e.g., request1, request2, etc). You can check this by studying the MediaServerControl class definition and checking the typedef for request_type. Boris From eric at boostpro.com Thu Sep 18 18:25:55 2008 From: eric at boostpro.com (Eric Niebler) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] polymorphism across dlls broken In-Reply-To: <20080918210512.GC9293@karelia> References: <48D28882.30008@boostpro.com> <20080918210512.GC9293@karelia> Message-ID: <48D2D573.7030302@boostpro.com> Boris Kolpackov wrote: > Eric Niebler writes: >> The solution, it seems, would be to move the definition of the >> type_serializer_map object into a separate dll, so that all dlls >> can share the instance. > > In the upcoming 3.2.0 release (should be out in a few weeks) we have > implemented support for exactly this. You can try it out in the beta: > > http://www.codesynthesis.com/pipermail/xsd-announcements/2008/000029.html > > Once you get the archive, look for the --export-maps and --import-maps > options in documentation/xsd.xhtml. > > In a nutshell, you will need to compile schemas that go to your "root" > DLL with the --export-maps. And schemas for all other DLLs and the > executable with --import-maps. Excellent, thanks for the quick response Boris. I've found a hackish work-around for 3.1 for the present and will upgrade to 3.2 when it comes out. -- Eric Niebler BoostPro Computing http://www.boostpro.com From sneeraj2 at yahoo.com Fri Sep 19 11:22:33 2008 From: sneeraj2 at yahoo.com (Neeraj Seshadri) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] XSDE support for element 'any' Message-ID: <278881.46404.qm@web31911.mail.mud.yahoo.com> Hi, Does the XSDE code generation support the element of form any as shown below When I tried to use this in my schema I am getting the following error. :0:0: error: Complex type '__AnonC1' violates the Unique Particle Attribution ru le in its components 'targetName' and '##any' This is useful in allowing extension points in the schema. Please let me know if there is a way to allow this. Thanks Neeraj From Raymond.Rizzuto at sig.com Fri Sep 19 16:15:38 2008 From: Raymond.Rizzuto at sig.com (Rizzuto, Raymond) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] no reaction on XSD_CXX_TREE_DECIMAL_PRECISION In-Reply-To: <20080915123552.GJ22047@karelia> References: <3054411AF4728548AD6D7137190D56B303DC3CF3@admin1.aeromap.com> <20080912083250.GB13410@karelia> <20080915123552.GJ22047@karelia> Message-ID: Boris, I probably will defer that to the next phase of this project. For now, I tested that setting XSD_CXX_TREE_DECIMAL_PRECISION=6 on the command line gave me the results I wanted. It worked beautifully! Instead of 49.04 being output as 49.039999999999999, it is output as 49.04. Ray -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Monday, September 15, 2008 8:36 AM To: Rizzuto, Raymond Cc: Gennady Khokhorin; xsd-users@codesynthesis.com Subject: Re: [xsd-users] no reaction on XSD_CXX_TREE_DECIMAL_PRECISION Hi Ray, Rizzuto, Raymond writes: > Let's say I have a message with two instances of the type (for example, > a type of temperature, one instance for internal, one for external). > Each of the two temperatures might have different precision, maybe > based on the accuracy of the respective temperature sensor. If I > understand you, my overridden type (for temperature) would need > an accessor function to allow setting the precision, and the > serialization logic would use the precision attribute. Yes, you can certainly implement it this way. Furthermore, the parsing logic can try to figure out the precision automatically based, for example, on the number of characters after '.' in the string representation. > I asked the author of the schema about specifying fractionDigits > in the schema, but he was not in favor of that idea. I know I > could create a modified version of his schema, but that would > be a maintenance nightmare since the schema has been in flux. Then you can use type customization to implement the fractionDigits behavior without having it in the schema. The custom/double example in 3.2.0 shows how to do something similar for the build-in double type though you would probably want to customize a user-defined type (e.g., temperature) which is even easier. Boris IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses. From mburnham at gblsys.com Mon Sep 22 14:29:09 2008 From: mburnham at gblsys.com (Matt Burnham) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] Multiple imports - (Re: Different C++ namespace for included schema) In-Reply-To: <20080918211016.GD9293@karelia> References: <48D29DF6.9050807@gblsys.com> <20080918211016.GD9293@karelia> Message-ID: <48D7E3F5.7090105@gblsys.com> Hi Boris, I've converted over to using namespaces in the schemas and using import instead of include, but I now have a problem with multiple imports. If I have 2 schemas (same namespace) and import them both into a third (different namespace), then when I reference them, I get an error of "Type not found" for the second one imported. test1.xsd: test2.xsd: ?xml version="1.0" encoding="UTF-8"?> test3.xsd: Thanks, Matt Boris Kolpackov wrote: > Hi Matt, > > > If the two schemas have the same XML Schema namespace (no namespace > in your case) and one includes the other then you will have to use > the same C++ namespace for both. > > The only way to achieve what you want would be to put the two schemas > into different XML Schema namespaces and use import instead of include. > > Boris From boris at codesynthesis.com Tue Sep 23 09:52:35 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] Re: Multiple imports - (Re: Different C++ namespace for included schema) In-Reply-To: <48D7E3F5.7090105@gblsys.com> References: <48D29DF6.9050807@gblsys.com> <20080918211016.GD9293@karelia> <48D7E3F5.7090105@gblsys.com> Message-ID: <20080923135235.GB13087@karelia> Hi Matt, Matt Burnham writes: > I've converted over to using namespaces in the schemas and using import > instead of include, but I now have a problem with multiple imports. If > I have 2 schemas (same namespace) and import them both into a third > (different namespace), then when I reference them, I get an error of > "Type not found" for the second one imported. When you import a schema for a namespace, XML Schema processors are allowed (and in fact most of them do it this way) to assume that this schema provides the complete description of the vocabulary. As a result any subsequent imports for this namespace are ignored. For cases where your vocabulary consist of multiple schemas the industry-standard practice is to have a top-level schema that includes all the individual schemas. Then the clients of your vocabulary import this top-level schema. Boris From Laura_E_Fowler at raytheon.com Tue Sep 23 15:57:49 2008 From: Laura_E_Fowler at raytheon.com (Laura E Fowler) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] Need help with creating Object Model from scratch Message-ID: I'm fairly new to XML and really new to XSD, so place have patience. I have been trying to figure out how to create an object model from scratch with our specific schema. I can't find an example that is similar to what we need to do. I have taken our schema and made it generic and it is below. I have been running xsd as follows: xsd cxx-tree --type-naming ucc --generate-inline --generate-ostream --generate-serialization ID is the S# of a carrier board or Unique ID for servers set to true if first time sent of any info has changed since last time sent. Please let me know if I haven't given you enough information. Any help that you can provide would be appreciated. Laura From boris at codesynthesis.com Tue Sep 23 17:02:51 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] Need help with creating Object Model from scratch In-Reply-To: References: Message-ID: <20080923210251.GA3235@karelia> Hi Laura, Laura E Fowler writes: > I have been trying to figure out how to create an object model from > scratch with our specific schema. I can't find an example that is similar > to what we need to do. The easiest way is to start with the top level element. In your case I believe it is Marker. This element is of anonymous type so the name of its class will also be Marker. We start by creating an instance of Marker: Marker m (...); Marker's constructor will have an argument for each required element or attribute. In our case type Marker has four required elements: id, deviceType, changed, and DeviceDescription. The first three arguments are easy: Marker m ("marker-1", DeviceType::TYPEA, true, ...); The last argument is of type DeviceDescription which itself contains elements. So we first need to create an object of this type: DeviceDescription dd; Marker m ("marker-1", DeviceType::TYPEA, true, dd); But here our dd instance does not have any elements inside. So we need to set one: DeviceDescriptionTypeB ddtb ("device-type-b"); DeviceDescription dd; dd.DeviceDescriptionTypeB (ddtb); Marker m ("marker-1", DeviceType::TYPEA, true, dd); The idea here is to start with the outer type and create and set inner objects as required. Here is the complete example (assumes the schema is saved as test.xsd): #include #include "test.hxx" using namespace std; using namespace library; int main () { DeviceDescriptionTypeB ddtb ("device-type-b"); DeviceDescription dd; dd.DeviceDescriptionTypeB (ddtb); Marker m ("marker-1", DeviceType::TYPEA, true, dd); // Print. // cerr << m << endl; // Write to XML. // xml_schema::NamespaceInfomap map; map["lib"].name = "http://www.codesynthesis.com/library"; map["lib"].schema = "test.xsd"; Marker_ (std::cout, m, map); } Boris From akram.eslami at se.transport.bombardier.com Thu Sep 25 01:10:40 2008 From: akram.eslami at se.transport.bombardier.com (akram.eslami@se.transport.bombardier.com) Date: Sun Oct 11 15:34:05 2009 Subject: [xsd-users] about xml error Message-ID: Helleo! I have a server program that I get xml message and after it I parse the message and send it back as xml again. I get this error when I debug my program. Could you be nice and help me with this. t@2 (l@2) terminated by signal SEGV (no mapping at the fault address) 0xfea43690: findBucketElem+0x002c: ld [%i3 + %l7], %i5 Current function is xsd::cxx::xml::initialize 80 xercesc::XMLPlatformUtils::Initialize (); Best regards Akram _______________________________________________________________________________________________________________ This e-mail communication (and any attachment/s) may contain confidential or privileged information and is intended only for the individual(s) or entity named above and to others who have been specifically authorized to receive it. If you are not the intended recipient, please do not read, copy, use or disclose the contents of this communication to others. Please notify the sender that you have received this e-mail in error by reply e-mail, and delete the e-mail subsequently. Please note that in order to protect the security of our information systems an AntiSPAM solution is in use and will browse through incoming emails. Thank you. _________________________________________________________________________________________________________________ Ce message (ainsi que le(s) fichier(s)), transmis par courriel, peut contenir des renseignements confidentiels ou prot?g?s et est destin? ? l?usage exclusif du destinataire ci-dessus. Toute autre personne est, par les pr?sentes, avis?e qu?il est strictement interdit de le diffuser, le distribuer ou le reproduire. Si vous l?avez re?u par inadvertance, veuillez nous en aviser et d?truire ce message. Veuillez prendre note qu'une solution antipollupostage (AntiSPAM) est utilis?e afin d'assurer la s?curit? de nos syst?mes d'information et qu'elle fur?tera les courriels entrants. Merci. _________________________________________________________________________________________________________________ From boris at codesynthesis.com Thu Sep 25 03:28:41 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] about xml error In-Reply-To: References: Message-ID: <20080925072841.GA19979@karelia> Hi Akram, akram.eslami@se.transport.bombardier.com writes: > I have a server program that I get xml message and after it I parse the > message and send it back as xml again. > I get this error when I debug my program. > > t@2 (l@2) terminated by signal SEGV (no mapping at the fault address) > 0xfea43690: findBucketElem+0x002c: ld [%i3 + %l7], %i5 > Current function is xsd::cxx::xml::initialize > 80 xercesc::XMLPlatformUtils::Initialize (); Is your server multi-threaded? If so then this can be caused by concurrent calls to XMLPlatformUtils::Initialize() from multiple threads. In multi-threaded applications you need to explicitly call Initialize() from main() (or a similar place where there is still no multi-threaded execution) and then pass the xml_schema::flags::dont_initialize flag to parsing and serialization functions: #include int main () { xercesc::XMLPlatformUtils::Initialize (); { // Start/terminate threads and parse/serialize here: std::auto_ptr t = parse ("file.xml", xml_schema::flags::dont_initialize); serialize (std::cout, *t, map, "UTF-8", xml_schema::flags::dont_initialize) } xercesc::XMLPlatformUtils::Terminate (); } For more information on thread safety see Section 3.4., "Thread Safety" in the C++/Tree Mapping Getting Started Guide: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#3.4 If your server is not multi-threaded or if this change does not help then we will need a test that reproduces this problem. You can send it directly to me if you would prefer not to make your schema/code public. Boris From jan.klimke at hpi.uni-potsdam.de Thu Sep 25 13:25:19 2008 From: jan.klimke at hpi.uni-potsdam.de (Jan Klimke) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Specifying Element content for "anyType" Elements In-Reply-To: <20080912082113.GA13410@karelia> References: <48C6A61D.1020605@hpi.uni-potsdam.de> <20080910090529.GB6428@karelia> <48C9874E.5060501@hpi.uni-potsdam.de> <20080912082113.GA13410@karelia> Message-ID: <48DBC97F.6040806@hpi.uni-potsdam.de> Thank you for your detailed answer. Unfortunately i did not have time to try it until today. THe customization works fine. I am able to specify the name of the binarycomaprison element. But one big problem remains. I am currently doing the following in my code: schemas::coll::Boolean& b = schemas::coll::Boolean(true); xml_schema::string& name = xml_schema::string("coll:isActive"); ogc::LiteralType& lit = (ogc::LiteralType&)b; ogc::PropertyNameType& pname = (ogc::PropertyNameType&)name; ogc::BinaryComparisonOpType& isEqualActive = ogc::BinaryComparisonOpType(); ogc::BinaryComparisonOpType::expression_sequence& expressions = ogc::BinaryComparisonOpType::expression_sequence(); expressions.push_back(pname); expressions.push_back(lit); isEqualActive.expression(expressions); filter.comparisonOps(isEqualActive); filter.setOpName(std::string("PropertyIsEqualTo")); When i serialize the filter object the PropertyNameType and Literal object are serialized as expression elements, but they should be PropertyName and Literal elements to be accepted by the service i plan to call. coll:isActive true So the serialization method from Expression is obviously used. What am i doing wrong ? Did i miss something ? Jan Boris Kolpackov schrieb: > Hi Jan, > > Jan Klimke writes: > > >> i tried to create an PropertyIsEqualTo element which is defined as follows: >> >> > type="ogc:BinaryComparisonOpType" >> substitutionGroup="ogc:comparisonOps"/> >> >> [...] >> >> As you can see, the generated element is not the desired one but >> "PropertyIsGreaterThanOrEqualTo". >> >> This element is defined like the PropertyIsEqualTo element: >> >> > type="ogc:BinaryComparisonOpType" substitutionGroup="ogc:comparisonOps"/> >> >> Because they are both of the same type no other class as >> ogc:BinaryComparisonOpType is generated. >> > > It looks like this schema is using element names as some sort of > identifiers even though they are all of the same type. This does > not work very well with XSD's automatic handling of substitution > groups since the generated code uses the first element name that > matches the type. I see two ways how you can resolve this: > > 1. You can change the schema to an equivalent one but which assigns > different types to different operation elements. This schema will > be equivalent to the original in the sense that it will define > the same XML vocabulary: > > > > > > > > type="ogc:IsEqualToType" > substitutionGroup="ogc:comparisonOps"/> > > > > > > > > type="ogc:IsGreaterThanOrEqualToType" > substitutionGroup="ogc:comparisonOps"/> > > And so on for all the elements that substitute comparisonOps and are > of the BinaryComparisonOpType type. > > 2. The second method is quite a bit more involved but does not require > any schema modifications. With this method you will need to customize > all the types that contain the comparisonOps element (e.g., FilterType). > Your customization will need to do two things: > > a) Add a mechanism for specifying which element name should be used. > This can be a modifier function that passes element name as a > string. > > b) Customize the serialization operator to change the name of the > DOM element. > > > For more information on type customization, see the C++/Tree > Mapping Customization Guide: > > http://wiki.codesynthesis.com/Tree/Customization_guide > > There is also a bunch of examples in the examples/cxx/tree/custom/ > directory with the most relevant to your case being 'wildcard'. > > Here is an outline of the FilterType implementation. In your case > you don't need to customize parsing so we just call the base > implementation (or you can change it to extract the operation > name from DOM): > > class FilterType: public FilterTypeBase > { > public: > void > comparisonOpName (const std::string& name) > { > comparisonOpName_ = name; > } > > const std::string& > comparisonOpName () const > { > return comparisonOpName_; > } > > // Parsing constructor. Just call our base. > // > FilterType (const xercesc::DOMElement& e, > xml_schema::flags = 0, > xml_schema::container* = 0) > : data_base (e, f, c) > { > } > > ... > > private: > std::string comparisonOpName_; > }; > > // Serialization operator. > // > void > operator<< (xercesc::DOMElement&, const FilterType& f) > { > // Use our base to serialize data and id. > // > const FilterTypeBase& fb (f); > e << fb; > > if (f.comparisonOps ().present ()) > { > // Change the name of the child element of 'e' to the one > // returned by f.comparisonOpName (). Use the renameNode() > // function on DOMDocument. > } > } > > When you use this type in your code you will need to set the > actual name of the comparisonOps element manually. > > > >> And also the instance of PropertyNameType and LiteralType where not >> serialized as the elements i wanted. >> > > It is hard to answer this without knowing what you actually wanted ;-). > > > >> The other issue i found was assigning boolean values as a LiteralType >> instance. The does not work because xml_schema::boolean does not >> derrive from xml_schema::type. >> > > That's right. Types that are mapped to fundamental C++ types cannot > be used for dynamic typing. What you can do is add a type that derives > from the boolean XML Schema type: > > > > > > Then you can use this type since it will be derived from xml_schema::type. > > Boris > From boris at codesynthesis.com Fri Sep 26 07:15:30 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Specifying Element content for "anyType" Elements In-Reply-To: <48DBC97F.6040806@hpi.uni-potsdam.de> References: <48C6A61D.1020605@hpi.uni-potsdam.de> <20080910090529.GB6428@karelia> <48C9874E.5060501@hpi.uni-potsdam.de> <20080912082113.GA13410@karelia> <48DBC97F.6040806@hpi.uni-potsdam.de> Message-ID: <20080926111530.GA24643@karelia> Hi Jan, Jan Klimke writes: > When i serialize the filter object the PropertyNameType and Literal > object are serialized as expression elements, but they should be > PropertyName and Literal elements to be accepted by the service i plan > to call. Can you show how PropertyName and Literal elements are defined in the schema? For this to work they would need to substitute the expression element and be of xsd:string and coll:Boolean types, respectively. Boris From jan.klimke at hpi.uni-potsdam.de Fri Sep 26 08:03:02 2008 From: jan.klimke at hpi.uni-potsdam.de (Jan Klimke) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Specifying Element content for "anyType" Elements In-Reply-To: <20080926111530.GA24643@karelia> References: <48C6A61D.1020605@hpi.uni-potsdam.de> <20080910090529.GB6428@karelia> <48C9874E.5060501@hpi.uni-potsdam.de> <20080912082113.GA13410@karelia> <48DBC97F.6040806@hpi.uni-potsdam.de> <20080926111530.GA24643@karelia> Message-ID: <48DCCF76.8000108@hpi.uni-potsdam.de> Hi Boris, the elements are part of the ogc filter specification. The overall filter schema is this: Thank you for you help, Jan Boris Kolpackov wrote: > Hi Jan, > > Jan Klimke writes: > > >> When i serialize the filter object the PropertyNameType and Literal >> object are serialized as expression elements, but they should be >> PropertyName and Literal elements to be accepted by the service i plan >> to call. >> > > Can you show how PropertyName and Literal elements are defined > in the schema? For this to work they would need to substitute > the expression element and be of xsd:string and coll:Boolean > types, respectively. > > Boris > From simmich at soe.sony.com Mon Sep 29 13:20:13 2008 From: simmich at soe.sony.com (Immich, Stefan) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Visual Studio 2005: error C2039: 'iterator_category' : is not a member of... Message-ID: <7EA6A25EC6360A488E0EBB5F3F21A0DC20EE7AC5@mail-sd4.ad.soe.sony.com> We have recently tried to migrate our code base from Visual Studio 2003 to Visual Studio 2005. However we ran into problems using our through xsd generated classes in conjunction with stl algorithms. Those previously worked fine. Example. For the following piece of code we get the error listed below: std::transform( m_configuration->AuthServers().get().Connection().begin(), m_configuration->AuthServers().get().Connection().end(), std::back_inserter( m_authServers ), EndpointAdapaterFactory() ); And the error message: c:\program files\microsoft visual studio 8\vc\include\xutility(610) : error C2039: 'iterator_category' : is not a member of 'xsd::cxx::tree::iterator_adapter' 1> with 1> [ 1> I=std::_Vector_iterator::ptr,std::allocator: :ptr>> 1> ] 1> c:\program files\microsoft visual studio 8\vc\include\algorithm(695) : see reference to class template instantiation 'std::iterator_traits<_Iter>' being compiled 1> with 1> [ 1> _Iter=xsd::cxx::tree::iterator_adapter::ptr,std::allocator::ptr>>> 1> ] 1> c:\blabla.cpp(69) : see reference to function template instantiation 'std::back_insert_iterator<_Container> std::transform,std::back_insert_iter ator<_Container>,lp2::EndpointAdapaterFactory>(_InIt,_InIt,_OutIt,_Fn1)' being compiled 1> with 1> [ 1> _Container=lp2::IStationConfiguration::Endpoints, 1> I=std::_Vector_iterator::ptr,std::allocator: :ptr>>, 1> _InIt=xsd::cxx::tree::iterator_adapter::ptr,std::allocator::ptr>>>, 1> _OutIt=std::back_insert_iterator, 1> _Fn1=lp2::EndpointAdapaterFactory 1> ] 1>c:\program files\microsoft visual studio 8\vc\include\xutility(610) : error C2146: syntax error : missing ';' before identifier 'iterator_category' 1>c:\program files\microsoft visual studio 8\vc\include\xutility(610) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int From boris at codesynthesis.com Mon Sep 29 14:29:36 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Visual Studio 2005: error C2039: 'iterator_category' : is not a member of... In-Reply-To: <7EA6A25EC6360A488E0EBB5F3F21A0DC20EE7AC5@mail-sd4.ad.soe.sony.com> References: <7EA6A25EC6360A488E0EBB5F3F21A0DC20EE7AC5@mail-sd4.ad.soe.sony.com> Message-ID: <20080929182936.GD11593@karelia> Hi Stefan, Immich, Stefan writes: > c:\program files\microsoft visual studio 8\vc\include\xutility(610) : > error C2039: 'iterator_category' : is not a member of > 'xsd::cxx::tree::iterator_adapter' That's strange since there is iterator_category in xsd::cxx::tree::iterator_adapter. Which version of XSD are you using? Boris From Raymond.Rizzuto at sig.com Mon Sep 29 15:19:35 2008 From: Raymond.Rizzuto at sig.com (Rizzuto, Raymond) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] RE: XSD 3.2.0 beta1 released Message-ID: I saw in a posting from 12-Sept that "the final release is coming soon (2-3 weeks)". I'm hoping that means early October. Can you give us an updated projection? Ray ________________________________ Ray Rizzuto raymond.rizzuto@sig.com Susquehanna International Group (610)747-2336 (W) (215)776-3780 (C) ________________________________ IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses. From boris at codesynthesis.com Mon Sep 29 17:40:22 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] RE: XSD 3.2.0 beta1 released In-Reply-To: References: Message-ID: <20080929214022.GB12771@karelia> Hi Ray, Rizzuto, Raymond writes: > I saw in a posting from 12-Sept that "the final release is coming > soon (2-3 weeks)". I'm hoping that means early October. > > Can you give us an updated projection? Yes, the current projection is tomorrow (Tuesday). Boris From jan.klimke at hpi.uni-potsdam.de Tue Sep 30 07:18:01 2008 From: jan.klimke at hpi.uni-potsdam.de (Jan Klimke) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] problem with utf-8 encoding Message-ID: <48E20AE9.4080504@hpi.uni-potsdam.de> Hi, i got a problem serializing object structures which contain characters like '?' or '?'. I Allready had a look into the code. The problem arises when transcoding the string to xmlch. The following funtction throws an 'invalid_utf8_string' exception: template XMLCh* char_transcoder::from (const C* s, std::size_t len) Those characters should be valid according to my mind. Their "UTF-8" code is 252 '?' and 228 '?'. Do i have to use a wchar ? Or how am i able to correctly serialize strings containing such characters ? Greetings, Jan From Raymond.Rizzuto at sig.com Tue Sep 30 08:58:47 2008 From: Raymond.Rizzuto at sig.com (Rizzuto, Raymond) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] RE: XSD 3.2.0 beta1 released In-Reply-To: <20080929214022.GB12771@karelia> References: <20080929214022.GB12771@karelia> Message-ID: That's wonderful news! I'm looking forward to moving to the new version. -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Monday, September 29, 2008 5:40 PM To: Rizzuto, Raymond Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] RE: XSD 3.2.0 beta1 released Hi Ray, Rizzuto, Raymond writes: > I saw in a posting from 12-Sept that "the final release is coming > soon (2-3 weeks)". I'm hoping that means early October. > > Can you give us an updated projection? Yes, the current projection is tomorrow (Tuesday). Boris IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses. From boris at codesynthesis.com Tue Sep 30 09:38:49 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] XSD 3.2.0 released Message-ID: <20080930133849.GA16900@karelia> Hi, We have released XSD 3.2.0. The NEWS file entries for this release are as follows: * New option, --disable-warning, disables printing of a warning with the specified id. Specifying 'all' for the warning id disables all warnings. * New options, --export-maps and --import-maps, provide support for splitting a polymorphic type hierarchy across several Win32 DLLs. See the compiler command line manual (man pages) for details. C++/Tree * During serialization the generated code automatically assigns generic prefixes (p1, p2, etc) to XML namespaces used in the vocabulary and for which no custom prefix-namespace mapping was provided via the xml_schema::namespace_infomap argument. The xml_schema::namespace_infomap argument in the serialization functions is now default-initialized to an empty map. The xml_schema::no_namespace_mapping and xml_schema::xsi_already_in_use exceptions have been removed. * New example, performance, measures the performance of parsing and serialization. This example also shows how to structure your code to achieve the maximum performance for these two operations. * New example, xpath, shows how to use the C++/Tree mapping together with XPath. * New options, --one-accessor-regex, --opt-accessor-regex, --seq-accessor-regex, --one-modifier-regex, --opt-modifier-regex, and --seq-modifier-regex, allow specification of transformations for accessor and modifier function names for elements and attributes with specific cardinalities. For more information see the NAMING CONVENTION section in the compiler command line manual (man pages). * Support for comparison (--generate-comparison) and printing (--generate-ostream) of polymorphic object models. * New serialization flag, xml_schema::flags::dont_pretty_print, disables extra spaces and new lines that make the resulting XML slightly bigger but easier to read. * New example, custom/double, shows how to customize parsing and serialization code for the xsd:double XML Schema built-in type. It can be used as a guide on how to customize built-in XML Schema types that are mapped to fundamental C++ types. * Support for fractionDigits and totalDigits facets in serialization of types derived from xsd:decimal. * New set of compile-time macros that control how the xsd:float, xsd:double, and xsd:decimal types are serialized. The following macros control the format: XSD_CXX_TREE_FLOAT_FIXED XSD_CXX_TREE_FLOAT_SCIENTIFIC XSD_CXX_TREE_DOUBLE_FIXED XSD_CXX_TREE_DOUBLE_SCIENTIFIC The following macros control the precision: XSD_CXX_TREE_FLOAT_PRECISION_MAX XSD_CXX_TREE_FLOAT_PRECISION XSD_CXX_TREE_DOUBLE_PRECISION_MAX XSD_CXX_TREE_DOUBLE_PRECISION XSD_CXX_TREE_DECIMAL_PRECISION_MAX XSD_CXX_TREE_DECIMAL_PRECISION If the *_PRECISION_MAX macro is defined then the maximum number of potentially significant decimal digits that the type can represent is used. Otherwise, if the *_PRECISION macro is defined then its value is used. By default the precision is set to the number of decimal digits that the type can represent without change. For more information on these options, refer to the following paper: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdf The old macro, XSD_FP_ALL_DIGITS, that was equivalent to defining all three *_PRECISION_MAX macros has been removed. An alternative to using these macros is to customize the floating point type as shown in the custom/double example. * An additional constructor is generated in situations where a type contains one or more required element of complex type (that is, it itself contains elements or attributes). In this constructor, initializers for such elements are passed as std::auto_ptr and the newly created instance is directly initialized with and assumes ownership of the pointed to objects. This constructor is a logical addition to the non-copying modifiers that were introduced in the previous version. * Extra conversion operators in the fundamental_base class template which is used to emulate inheritance from fundamental types are now disabled by default since they cause problems on several compilers. To enable them compile your code with the XSD_TREE_EXTRA_FUND_CONV macro defined. C++/Parser * New options, --generate-xml-schema and --extern-xml-schema, trigger generation of the mapping for the XML Schema namespace to a separate header file and inclusion of that header into other generated header files instead of generating the necessary declarations inline, respectively. See the compiler command line manual (man pages) for details. * New example, performance, measures the performance of XML parsing. This example also shows how to structure your code to achieve the maximum performance for this operation. * Type map files can now include comments. A comment starts with # and ends with a new line or end of file. To specify a name that contains # enclose it in "". * In type map files the optional argument type now defaults to the return type if the return type ends with * or & (that is, it is a pointer or a reference) and 'const return type&' otherwise. * The interface for polymorphic parsing has been simplified. Calling the *_parser() functions multiple times to specify several parsers is no longer supported. Instead you need to pass the xml_schema::parser_map object which contains the parsers. For more information refer to Section 5.4, "Support for Polymorphism" in the C++/Parser Mapping Getting Started Guide. * The use of virtual inheritance has been reduced which results in a much smaller object code size (more than factor of 2 on some tests) and faster C++ compilation with less RAM used. * The low-level Expat-specific parsing API (parse_begin() and parse_end()) has been extended to provide XML and XML Schema error translation to exceptions or error handler calls. See Section 7.2, "Expat Document Parser" in the C++/Parser Mapping Getting Started Guide for more information. Furthermore, this version of XSD has been extensively tested with the just released Xerces-C++ 3.0.0 and all precompiled binary distributions are build with this version of Xerces-C++. Due to static library name changes between Xerces-C++ 2.8.0 and 3.0.0, the Visual Studio projects and solutions have been split. Solutions in the form tree.sln link to Xerces-C++ 3.0.0 while solutions in the form tree-xerces2.sln link to 2.8.0. Thanks to the following individuals for reporting bugs as well as suggesting fixes and improvements: Gennady Khokhorin Uri Karagila Gordon Kramer Ryan Prather Shivakumar Balasubramanyam Timothy K Lenz Nick John Samuel Toulouse David Moss Roger Evans Joe Mcduffey Mario Lang Manav Rathi Matthew Hutchins Bruno Marotta Ray Lischner Thierry Seegers Raymond Rizzuto Aaron Bray Petteri Tolonen Forstner Michael Jeroen N. Witmond Alan Pettitt Rance Kirtley Michael Coulman Mark Stevens Eric Niebler Precompiled binary distributions are available from the product's download page: http://www.codesynthesis.com/products/xsd/download.xhtml Source code for this release is available from the project's web page: http://www.codesynthesis.com/projects/xsd/ SHA1 checksums for the files: cbf104bdb158d68416d1e7184930f2f06e0df151 xsd-3.2.0.tar.bz2 4b950de34b61cd78c0cd3fc2b01cfa4066b75996 xsd-3.2.0-powerpc-aix.tar.gz 7e4cb3bc0a3ee6ec3d2bc5798a7b412c3883d6e4 xsd_3.2.0-1_i386.deb ab5cc6dae39a2dc26085354dd53aa62ff68b437e xsd-3.2.0-1.i686.rpm bd6b217012a6cda07ae0f7597ee4f23470dba06a xsd-3.2.0-i686-linux-gnu.tar.bz2 7999fc878055bcf208cc0ab674bb8de694dbb760 xsd_3.2.0-1_amd64.deb afce842c1ec62b8d423cebfb2b8f7c104399c9fa xsd-3.2.0-1.x86_64.rpm d044e0af9db2335215b3f69592623055b4dca545 xsd-3.2.0-x86_64-linux-gnu.tar.bz2 d0b3f115f4a539c523482ef53a1398df68595757 xsd-3.2.0-powerpc-linux-gnu.tar.bz2 43c2143d4b198a0b5723ee4d8fc1c7b03e0854cb xsd-3.2.0-ia64-linux-gnu.tar.bz2 ba0054f4cb64206e851a6304966725adf0d801fb xsd-3.2.0-hppa-hpux.tar.gz f2888f8a80530fa69945206bc9da2aa9b4900259 xsd-3.2.0-powerpc-macosx.tar.bz2 0893ac4aca5eb0059e20de8557135a37f3b26337 xsd-3.2.0-i686-macosx.tar.bz2 99e46fe617079ca68bfe586e3a9888741a612b21 xsd-3.2.0-sparc-solaris.tar.gz 9d54011989cbf89971c8549a138df085d09a33c4 xsd-3.2.0-i686-solaris.tar.gz ac74860b1f69c86b764e6a015b0cce1ebf05dc4f xsd-3.2.0-i686-windows.zip b56974dcd880e3c5c246b23a9333f126966f5d03 xsd-3.2.msi Enjoy, Boris From boris at codesynthesis.com Tue Sep 30 09:52:56 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Xerces-C++ 3.0.0 released Message-ID: <20080930135256.GC16900@karelia> Hi, Xerces-C++ 3.0.0 was released yesterday. The summary of the major new features is as follows: * Autotools-based build system for the UNIX/Linux/Mac OS X platforms * Project files for VC++ 9 * Support for the ICU transcoder in VC++ 7.1, 8, and 9 project files * libcurl-based net accessor * Support for XInclude in DOM * Support for both XPath 1 and XPath 2 models in the DOM XPath interface * Support for the XML Schema subset of XPath 1 in DOM * Conformance to the final DOM Level 3 interface specification * Ability to provide custom DOM memory manager as well as tune the global DOM heap parameters * All public and widely used interfaces as well as a large portion of the implementation were converted to be 64-bit safe. * Various XML Schema fixes including the fix for the large maxOccurs and minOccurs bug as well as for the changed ##other interpretation * Reviewed and cleaned up diagnostics messages * Optimizations for SAX/SAX2 and DOM parsing as well as XML Schema validation For the official announcement please see: http://marc.info/?l=xerces-c-users&m=122271268809967&w=2 Source code as well as precompiled binaries for a number of platforms can be downloaded from the Xerces-C++ Download page: http://xerces.apache.org/xerces-c/download.cgi XSD 3.2.0 was extensively tested with Xerces-C++ 3.0.0 (prior to the release of both packages) and all precompiled binaries from now on will be built with this (or later) version of Xerces-C++. Boris From boris at codesynthesis.com Tue Sep 30 10:56:41 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] Specifying Element content for "anyType" Elements In-Reply-To: <48DCCF76.8000108@hpi.uni-potsdam.de> References: <48C6A61D.1020605@hpi.uni-potsdam.de> <20080910090529.GB6428@karelia> <48C9874E.5060501@hpi.uni-potsdam.de> <20080912082113.GA13410@karelia> <48DBC97F.6040806@hpi.uni-potsdam.de> <20080926111530.GA24643@karelia> <48DCCF76.8000108@hpi.uni-potsdam.de> Message-ID: <20080930145641.GA17276@karelia> Hi Jan, Jan Klimke writes: > substitutionGroup="ogc:expression"/> > [...] > > substitutionGroup="ogc:expression"/> > > [...] > > > > > > > > > > > > > > > As you can see from the definitions above, PropertyName and Literal elements are of types PropertyNameType and LiteralType, respectively. If you want to get these elements in your XML in place of expression then you will need to create instances of these types instead of xsd:string and coll:Boolean as you do now. Boris From boris at codesynthesis.com Tue Sep 30 11:04:15 2008 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:06 2009 Subject: [xsd-users] problem with utf-8 encoding In-Reply-To: <48E20AE9.4080504@hpi.uni-potsdam.de> References: <48E20AE9.4080504@hpi.uni-potsdam.de> Message-ID: <20080930150415.GB17276@karelia> Hi Jan, Jan Klimke writes: > Those characters should be valid according to my mind. Their "UTF-8" > code is 252 '?' and 228 '?'. No, in UTF-8 these characters are encoded as two-byte sequences. > Do i have to use a wchar ? Or how am i able to correctly serialize > strings containing such characters ? There has been a similar question not long ago. Please check these two replies for more information on your options: http://www.codesynthesis.com/pipermail/xsd-users/2008-June/001734.html http://www.codesynthesis.com/pipermail/xsd-users/2008-June/001736.html Boris