From sir.costy at gmail.com Thu Apr 2 04:01:52 2009 From: sir.costy at gmail.com (Constantin Iacobescu) Date: Sun Oct 11 15:34:08 2009 Subject: [xsd-users] XSD Licence Isue Message-ID: Hi Boris, I have read the: + GNU General Public License (GPL), version 2 + FLOSS Exception but I'm still a bit confused of the right of using it in a commercial application. I am speaking about an program which uses the XSD generated code to import and export data from/to xml files (LandXML, KML). Of course this import/export is made on runtime. I use the generated code by XSD to made a statical library which has includes for the libxsd files (to may compile and use it). So it is not linked wit some XSD precompiled library, just includes the files from libxsd folder. Also I had added to my library some classes which use the generated code classes and let me to parse and serialise xml files more easy. So I can import the data included in a xml file and/or export in a xml file format. So may I use XSD as a free license for my purpose? Or I need to buy some license? Thanks for help, Constantin Iacobescu From boris at codesynthesis.com Thu Apr 2 05:42:02 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:08 2009 Subject: [xsd-users] XSD Licence Isue In-Reply-To: References: Message-ID: Hi Constantin, Constantin Iacobescu writes: > I am speaking about an program which uses the XSD generated code to import > and export data from/to xml files (LandXML, KML). Of course this > import/export is made on runtime. > > I use the generated code by XSD to made a statical library which has > includes for the libxsd files (to may compile and use it). So it is not > linked wit some XSD precompiled library, just includes the files from libxsd > folder. > Also I had added to my library some classes which use the generated code > classes and let me to parse and serialise xml files more easy. So I can > import the data included in a xml file and/or export in a xml file format. > > So may I use XSD as a free license for my purpose? Or I need to buy some > license? In this scenario you have three options: 1. You can release the generated code and your program with full source code under the GPL. 2. You can release the generated code and your program with full source code under another open-source license. This option is covered by the FLOSSE. Note that you cannot release just the generated code (and a few helper classes) under an open-source license and then use it in your closed-source application. This kind of "relicensing" of the generated code is explicitly prohibited by FLOSSE. 3. You can obtain a proprietary license for the generated code in which case you will be free to distribute it and your application in object code or executable form and keep the source code for your application private. If you are interested in this option, contact sales@codesynthesis.com directly. Boris From dkodko at yahoo.com Thu Apr 9 13:36:11 2009 From: dkodko at yahoo.com (dd ddd) Date: Sun Oct 11 15:34:08 2009 Subject: [xsd-users] C++/Hybrid , xsi:nil Message-ID: <617064.76847.qm@web45303.mail.sp1.yahoo.com> Boris, would you be able to comment on the below 2 questions, please... 1. what would be the timeline for adopting/implementing C++/Serializer, C++/Hybrid approaches to XSD (since XSDe already has it released)??http://www.codesynthesis.com/projects/xsd/documentation/future.xhtml 2. regarding nillable and xsi:nil ?i did trace several discussions and i believe there are substential grounds for having nillable/xsi:nil implemented in the core templates, although i understand there is a fairly simple work around with customization approach as you outlined herehttp://www.codesynthesis.com/pipermail/xsd-users/2007-June/001070.html ?? ?a. my understanding that if element is defined with nillable="true" and xml produced contains empty element without xsi:nil="true" it should fail full schema validation (btw, for Xerces parsing wrapper implementation in XSD?fgXercesSchemaFullChecking?is always explicitly turned off, which i think may be also left configurable through?xsd::cxx::tree::flags for example), although xs:string without facets is an exceptional case here (XMLSpy and JAXB2.0 for example interpret it that way, i.e. producing ? is invalid, where is valid)?? ?http://www.w3.org/TR/xmlschema-1/#xsi_nil????? b. with regards to practical application this feature is pretty handy when for example need to indicate the elements to be deleted let's say from database when having schemas exposed as API contracts/webservices (more so in case of complexType entities), instead of introducing custom mechanisms to indicate that cheers, dmitry From boris at codesynthesis.com Fri Apr 10 09:35:15 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:08 2009 Subject: [xsd-users] C++/Hybrid , xsi:nil In-Reply-To: <617064.76847.qm@web45303.mail.sp1.yahoo.com> References: <617064.76847.qm@web45303.mail.sp1.yahoo.com> Message-ID: Hi dmitry, writes: > 1. what would be the timeline for adopting/implementing C++/Serializer, C++/Hybrid approaches to XSD (since XSDe already has it released)?? There are currently no immediate plans to port these two mapping to XSD though we may do this some time in the future. We first want to let them mature and become more or less feature-complete in XSD/e so that we don't maintain two similar code bases. Also note that nothing prevents you from using XSD/e even on non- embedded, general-purpose platforms. If you configure the runtime and generated code with STL, C++ exceptions, and iostream enabled, you will get pretty much what will end up in XSD. > 2. regarding nillable and xsi:nil i did trace several discussions and i believe there are substential grounds for having nillable/xsi:nil implemented [...] This feature is very awkward to use in the XML documents which is probably why very few real-world schemas use it. I think you are the second or third person asking about it over the past several years. There will also be quite a bit of work to support it in C++/Tree. In particular, we will need to provide special versions of the one, optional, and sequence containers for nilable elements. Overall, this does not seem like a rational way to spend our resources. You therefore have choice of either implementing it yourself (and possible contributing the changes back) or having us implement it on a commercial basis as a custom development service. Boris From boris at codesynthesis.com Mon Apr 13 09:59:17 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:08 2009 Subject: [xsd-users] Re: Problem with XSD (linking with static xercesc library) In-Reply-To: <49DF3788.7010809@mail.ru> References: <49DF3788.7010809@mail.ru> Message-ID: Hi, In the future please send technical questions like these to the xsd-users mailing list (which I've CC'ed) instead of to me directly. This way other developers who may have experienced a similar problem can provide you with a solution. Plus questions and answers will be archived and available to others with similar problems. zanneo writes: > I've problem with using static xercesc library (2.8 and 3.0). VC++ 2008 > shows (linking): > > test.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: virtual __thiscall > xercesc_2_8::Wrapper4InputSource::~Wrapper4InputSource(void)" > (__imp_??1Wrapper4InputSource@xercesc_2_8@@UAE@XZ) referenced in > function "struct xsd::cxx::xml::dom::auto_ptr xercesc_2_8::DOMDocument> __cdecl xsd::cxx::xml::dom::parse(class > xercesc_2_8::InputSource &,class xercesc_2_8::DOMErrorHandler &,class > xsd::cxx::xml::properties const &,unsigned long)" > (??$parse@D@dom@xml@cxx@xsd@@YA?AU?$auto_ptr@VDOMDocument@xercesc_2_8@@@0123@AAVInputSource@xercesc_2_8@@AAVDOMErrorHandler@6@ABV?$properties@D@123@K@Z) > > [...] > > > How can I resolve this problem? Please, help me. > P.S. when I use dynamic xercesc library (2.8 and 3.0) - it is normal > linking and running. For 2.8.0 you need to compile your application code (including the generated code) with the XML_LIBRARY preprocessor define as instructed in the documentation[1]. For 3.0.x this symbols is called XERCES_STATIC_LIBRARY[2]. The easiest way to achieve this is to add one of these defines to the VC++ project settings. [1] http://xerces.apache.org/xerces-c/build-winunix-2.html#WinNT [2] http://xerces.apache.org/xerces-c/build-3.html#Windows Boris From boris at codesynthesis.com Wed Apr 15 03:48:33 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:08 2009 Subject: [xsd-users] XSD/e 3.1.0 released Message-ID: Hi, We have released XSD/e 3.1.0. XSD/e is our mobile/embedded systems version of XSD. Major new features in this release include support for XML Schema polymorphism (xsi:type and substitution groups), binary serialization in XDR, CDR, and custom data representation formats, support for complete customization of the object model classes, support for default and fixed values, and support for recursive XML parsing and serialization. This release also adds official support and sample configurations for LynxOS 4.2 and 5.0 as well as VxWorks 6.7. For the complete and more detailed list of new features in this release, refer to the announcement email on the xsde-announcements mailing list: http://www.codesynthesis.com/pipermail/xsde-announcements/2009/000006.html Boris From odedkow at gmx.de Wed Apr 15 14:12:24 2009 From: odedkow at gmx.de (Oleg Dedkow) Date: Sun Oct 11 15:34:08 2009 Subject: [xsd-users] CityGML 1.0.0 and C++/Parser interface Message-ID: <008f01c9bdf5$ba79ee40$2f6dcac0$@de> Hey All, I?m trying to generate C++ classes for the CityGML 1.0.0 schemas (please, see the attached ZIP file) using C++/Parser interface. I?m using xsd 3.2.0 and was able to generate C++ classes using C++/Tree interface. However, this does not fit my needs, since I have to handle very large CityGML files that could not fit into memory. I get the following error using C++/Parser interface: CityGML\..\3.1.1\base\dictionary.xsd:43:79: error: unable to match restricted particle I?m using the following command line: xsd cxx-parser --generate-inline --generate-polymorphic --file-per-type --output-dir gen --namespace-map http://www.opengis.net/citygml/1.0=CityGML --namespace-map http://www.citygml.org/citygml/profiles/base/1.0=CityGML --namespace-map http://www.opengis.net/citygml/appearance/1.0=CityGML --namespace-map http://www.opengis.net/citygml/building/1.0=CityGML --namespace-map http://www.opengis.net/citygml/cityfurniture/1.0=CityGML --namespace-map http://www.opengis.net/citygml/cityobjectgroup/1.0=CityGML --namespace-map http://www.opengis.net/citygml/generics/1.0=CityGML --namespace-map http://www.opengis.net/citygml/landuse/1.0=CityGML --namespace-map http://www.opengis.net/citygml/relief/1.0=CityGML --namespace-map http://www.opengis.net/citygml/transportation/1.0=CityGML --namespace-map http://www.opengis.net/citygml/vegetation/1.0=CityGML --namespace-map http://www.opengis.net/citygml/waterbody/1.0=CityGML --namespace-map http://www.opengis.net/citygml/texturedsurface/1.0=CityGML --namespace-map urn:oasis:names:tc:ciq:xsdschema:xAL:2.0=CityGML::XAL --root-element CityModel CityGML.xsd The above-mentioned error is caused by the ?dictionary.xsd? schema which comes with included GML 3.1.1 package. The http://www.codesynthesis.com/projects/xsd/extras/supported-schemas.xhtml#gml site states that GML schema is only supported by the C++/Tree interface. I have done some search on the mailing list, but didn?t find any solution for my problem. Or, do I have overlooked something? Is it possible to use C++/Parser interface to compile CityGML 1.0.0/GML 3.1.1 schemas? If not, will it be possible to create some workaround? It would be OK for me to edit the local GML schemas. Best Regards, Oleg -------------- next part -------------- A non-text attachment was scrubbed... Name: CityGML_080815.zip Type: application/x-zip-compressed Size: 561769 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20090415/b545627d/CityGML_080815.bin From boris at codesynthesis.com Thu Apr 16 10:40:03 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:08 2009 Subject: [xsd-users] CityGML 1.0.0 and C++/Parser interface In-Reply-To: <008f01c9bdf5$ba79ee40$2f6dcac0$@de> References: <008f01c9bdf5$ba79ee40$2f6dcac0$@de> Message-ID: Hi Oleg, Oleg Dedkow writes: > I'm trying to generate C++ classes for the CityGML 1.0.0 schemas (please, > see the attached ZIP file) using C++/Parser interface. I'm using xsd 3.2.0 > and was able to generate C++ classes using C++/Tree interface. However, > this does not fit my needs, since I have to handle very large CityGML > files that could not fit into memory. I get the following error using > C++/Parser interface: > > dictionary.xsd:43:79: error: unable to match restricted particle The C++/Parser mapping is not yet capable of handling GML. GML uses non-trivial complex type restrictions that are not yet support. Also, the GML schemas are very complex, they use XML Schema polymorphism extensively, so handling CityGML document with C++/Parser is going to be a lot of hard work. If I were in your situation I would use C++/Tree but parse the documents chunk by chunk. Here is how I would do it: I would create a top-level SAX parser which constructs DOM fragments for portions of the document. Once the chunk is ready, the parser creates the corresponding C++/Tree object model and frees the DOM fragment. The object model can then be used by the application. Once the object model is processed, it is freed and the SAX parser moves on to the next chunk. This way you can handle fairly large CityGML/GML documents and remain sane at the same time ;-). As an example, consider this XML document:
Sample records sample001
... ... ... With the above approach the SAX parser will first create a DOM fragment corresponding to:
Sample records sample001
And parse it to the object model. This object model can then be kept around or processed and discarded. Then the parser will create a DOM fragment for each record, parse it to the object model, process, and discard. This approach is very similar to the partially in-memory/partially even-driven XML processing that we do in XSD/e (in embedded systems even relatively small documents can be too large to fit into RAM). See Section 6.1, "Customizing Parsers and Serializers" in the Embedded C++/Hybrid Mapping Getting Started Guide for details on how this works in XSD/e: http://codesynthesis.com/projects/xsde/documentation/cxx/hybrid/guide/#6.1 If you are interested, I could create an example that shows how to do all this with C++/Tree. > The above-mentioned error is caused by the dictionary.xsd schema which > [...] will it be possible to create some workaround? It would be OK for > me to edit the local GML schemas. You could probably "relax" the GML schema a bit and make it compile with C++/Parser. What causes the above error is the use of an element substitution in restriction. Here is an example (here Derived1 is derived- by-restriction from Base1): You can "relax" the above schema by using base instead of derived in Derived2. Boris From dawhite32 at gmail.com Fri Apr 17 00:52:52 2009 From: dawhite32 at gmail.com (David White) Date: Sun Oct 11 15:34:08 2009 Subject: [xsd-users] Extended exception information Message-ID: <97823d5c0904162152i5b46bfbbyf334f4a5487fce40@mail.gmail.com> Dear Boris, Consider a complex type defined as follows: If I attempt to parse an XML file which has the X, Y, Z in a different order, for example: 63.745 200.809 -186.489 I get an "instance document parsing failed", which is what I expect to get. No problems there. My question is - how do I get extended exception information as to where the error is? I am trapping the exception via: catch (const ::xml_schema::exception& e) { // print message cerr << e.what() << endl; } Is there another class that will give me extended information? Thanks in advance. Kind regards, David. From dawhite32 at gmail.com Fri Apr 17 00:55:33 2009 From: dawhite32 at gmail.com (David White) Date: Sun Oct 11 15:34:08 2009 Subject: [xsd-users] Fwd: Extended exception information In-Reply-To: <97823d5c0904162152i5b46bfbbyf334f4a5487fce40@mail.gmail.com> References: <97823d5c0904162152i5b46bfbbyf334f4a5487fce40@mail.gmail.com> Message-ID: <97823d5c0904162155o1b63f6e9r7d6a36773468c075@mail.gmail.com> I forgot to add - I am using xsd-parser, not xsd-tree. David. ---------- Forwarded message ---------- From: David White Date: Fri, Apr 17, 2009 at 2:52 PM Subject: Extended exception information To: xsd-users@codesynthesis.com Dear Boris, Consider a complex type defined as follows: ? ? ? ? ? ? ? ? ? ? If I attempt to parse an XML file which has the X, Y, Z in a different order, for example: ?63.745 ?200.809 ?-186.489 I get an "instance document parsing failed", which is what I expect to get. No problems there. ?My question is - how do I get extended exception information as to where the error is? ?I am trapping the exception via: catch (const ::xml_schema::exception& e) { ? ?// print message ? ?cerr << e.what() << endl; } Is there another class that will give me extended information? Thanks in advance. Kind regards, David. From dawhite32 at gmail.com Fri Apr 17 01:50:30 2009 From: dawhite32 at gmail.com (David White) Date: Sun Oct 11 15:34:08 2009 Subject: [xsd-users] Fwd: Extended exception information In-Reply-To: <97823d5c0904162155o1b63f6e9r7d6a36773468c075@mail.gmail.com> References: <97823d5c0904162152i5b46bfbbyf334f4a5487fce40@mail.gmail.com> <97823d5c0904162155o1b63f6e9r7d6a36773468c075@mail.gmail.com> Message-ID: <97823d5c0904162250l26a8bf7fs29e542b8c7a2dbd6@mail.gmail.com> Dear xsd-users, I think I have just worked it out: catch (const ::xml_schema::parsing& e) { stringstream ss(""); ss << e.what(); ::xsd::cxx::parser::diagnostics::const_iterator _it = e.diagnostics().begin(); for (_it; _it!=e.diagnostics().end(); _it++) { ss << endl; ss << " - line " << _it->line(); ss << ", column " << _it->column(); ss << ", severity " << _it->severity() << endl; ss << " - " << _it->message(); } cerr << ss.str(); } This is exactly what I was looking for... unless you can think of a better way??? Kind regards, David. ---------- Forwarded message ---------- From: David White Date: Fri, Apr 17, 2009 at 2:55 PM Subject: Fwd: Extended exception information To: xsd-users@codesynthesis.com I forgot to add - I am using xsd-parser, not xsd-tree. David. ---------- Forwarded message ---------- From: David White Date: Fri, Apr 17, 2009 at 2:52 PM Subject: Extended exception information To: xsd-users@codesynthesis.com Dear Boris, Consider a complex type defined as follows: ? ? ? ? ? ? ? ? ? ? If I attempt to parse an XML file which has the X, Y, Z in a different order, for example: ?63.745 ?200.809 ?-186.489 I get an "instance document parsing failed", which is what I expect to get. No problems there. ?My question is - how do I get extended exception information as to where the error is? ?I am trapping the exception via: catch (const ::xml_schema::exception& e) { ? ?// print message ? ?cerr << e.what() << endl; } Is there another class that will give me extended information? Thanks in advance. Kind regards, David. From boris at codesynthesis.com Fri Apr 17 04:45:19 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:08 2009 Subject: [xsd-users] Fwd: Extended exception information In-Reply-To: <97823d5c0904162250l26a8bf7fs29e542b8c7a2dbd6@mail.gmail.com> References: <97823d5c0904162152i5b46bfbbyf334f4a5487fce40@mail.gmail.com> <97823d5c0904162155o1b63f6e9r7d6a36773468c075@mail.gmail.com> <97823d5c0904162250l26a8bf7fs29e542b8c7a2dbd6@mail.gmail.com> Message-ID: Hi David, David White writes: > ::xsd::cxx::parser::diagnostics::const_iterator _it = > e.diagnostics().begin(); It is cleaner to use the xml_schema::diagnostics alias. > for (_it; _it!=e.diagnostics().end(); _it++) > { > ss << endl; > ss << " - line " << _it->line(); > ss << ", column " << _it->column(); > ss << ", severity " << _it->severity() << endl; > ss << " - " << _it->message(); > } You can do it this way if you want custom formatting. Otherwise, you can just print the exception: catch (const xml_schema::exception& e) { cerr << e << endl; } This is what all the examples do. See Section 7.3, "Error Handling" in the C++/Parser Mapping Getting Started Guide for more details: http://www.codesynthesis.com/projects/xsd/documentation/cxx/parser/guide/#7.3 Boris From jatkins at wintelligence.org Mon Apr 20 19:22:40 2009 From: jatkins at wintelligence.org (=?iso-8859-1?Q?jatkins?=) Date: Sun Oct 11 15:34:08 2009 Subject: [xsd-users] Optional Cardinality Issues Message-ID: <20090420232240.15672.qmail@s432.sureserver.com> Greetings! I know this is probably a really simple question, but I'm a bit confused at the moment. I'm having trouble generating XML from a wireless profile schema. I have no issues generating elements in the SSIDConfig section, but I'm struggling with the MSM content. A simple xml representation of a profile would look like: linksys 6C696E6B737973 linksys ESS open none false The SSIDConfig section uses sequence which I have no problems with. WLANProfile wlprofile(L"linksys", L"ESS"); SSID ssid; ssid.name(L"linksys"); SSIDConfig ssc; SSIDConfig::SSID_sequence& ssq(ssc.SSID()); ssq.push_back(ssid); WLANProfile::SSIDConfig_sequence& ss(wlprofile.SSIDConfig()); ss.push_back(ssc); The schema for this section generates typedef ::xsd::cxx::tree::sequence< SSID_type > SSID_sequence; The MSM section goes deeper and appears to be optional cardinality. How would I populate this information from scratch? I can populate the authencryption data, but I'm not sure how to populate this info within the WLANProfile object. There are no push_back/set methods once I populate the authEncryption object. class MSM: public ::xml_schema::type { public: // connectivity // typedef ::networking::WLAN::profile::v1::connectivity connectivity_type; typedef ::xsd::cxx::tree::optional< connectivity_type > connectivity_optional; typedef ::xsd::cxx::tree::traits< connectivity_type, wchar_t > connectivity_traits; const connectivity_optional& connectivity () const; connectivity_optional& connectivity (); void connectivity (const connectivity_type& x); void connectivity (const connectivity_optional& x); void connectivity (::std::auto_ptr< connectivity_type > p); // security // typedef ::networking::WLAN::profile::v1::security security_type; typedef ::xsd::cxx::tree::optional< security_type > security_optional; typedef ::xsd::cxx::tree::traits< security_type, wchar_t > security_traits; const security_optional& security () const; security_optional& security (); void security (const security_type& x); void security (const security_optional& x); void security (::std::auto_ptr< security_type > p); // Constructors. // MSM (); MSM (const ::xercesc::DOMElement& e, ::xml_schema::flags f = 0, ::xml_schema::container* c = 0); MSM (const MSM& x, ::xml_schema::flags f = 0, ::xml_schema::container* c = 0); virtual MSM* _clone (::xml_schema::flags f = 0, ::xml_schema::container* c = 0) const; virtual ~MSM (); // Implementation. // protected: void parse (::xsd::cxx::xml::dom::parser< wchar_t >&, ::xml_schema::flags); protected: connectivity_optional connectivity_; security_optional security_; }; //Set AuthEncryption authEncryption ae(authentication::open, encryption::none); authEncryption::useOneX_optional& uox(ae.useOneX()); uox.set(false); Any help is appreciated. The entire schema is attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: wlan_wlp.xsd Type: application/octet-stream Size: 15263 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20090420/fdae2142/wlan_wlp.obj From boris at codesynthesis.com Tue Apr 21 08:36:26 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:08 2009 Subject: [xsd-users] Optional Cardinality Issues In-Reply-To: <20090420232240.15672.qmail@s432.sureserver.com> References: <20090420232240.15672.qmail@s432.sureserver.com> Message-ID: Hi, jatkins writes: > > linksys > > > 6C696E6B737973 > linksys > > > ESS > > > > open > none > false > > > > > > [...] > > > WLANProfile wlprofile(L"linksys", L"ESS"); > > The MSM section goes deeper and appears to be optional cardinality. How > would I populate this information from scratch? It is actually even easier than the sequence cardinality. You simply need to create the MSM object and then call WLANProfile::MSM() setter to set it. In fact the most straightforward way to handle such deep object models is to start from the inside and work your way out: authEncryption ae ("open", "none"); ae.useOneX (false); security s; s.authEncryption (ae); MSM msm; msm.security (s); wlprofile.MSM (msm); Boris From jatkins at wintelligence.org Tue Apr 21 09:45:01 2009 From: jatkins at wintelligence.org (=?iso-8859-1?Q?jatkins?=) Date: Sun Oct 11 15:34:09 2009 Subject: =?iso-8859-1?B?UmU6IFt4c2QtdXNlcnNdIE9wdGlvbmFsIENhcmRpbmFsaXR5IElzc3Vlcw==?= Message-ID: <20090421134502.23290.qmail@s432.sureserver.com> Thank you very much! I just wasnt seeing it in the object model. > -------Original Message------- > From: Boris Kolpackov > Subject: Re: [xsd-users] Optional Cardinality Issues > Sent: 21 Apr '09 07:36 > > Hi, > > jatkins writes: > > > > >???????? linksys > >???????? > >???????????????? > >???????????????????????? 6C696E6B737973 > >???????????????????????? linksys > >???????????????? > >???????? > >???????? ESS > >???????? > >???????????????? > >???????????????????????? > >???????????????????????????????? open > >???????????????????????????????? none > >???????????????????????????????? false > >???????????????????????? > >???????????????? > >???????? > > > > > > [...] > > > > > > WLANProfile wlprofile(L"linksys", L"ESS"); > > > > The MSM section goes deeper and appears to be optional cardinality. How > > would I populate this information from scratch? > > It is actually even easier than the sequence cardinality. You simply > need to create the MSM object and then call WLANProfile::MSM() setter > to set it. In fact the most straightforward way to handle such deep > object models is to start from the inside and work your way out: > > authEncryption ae ("open", "none"); > ae.useOneX (false); > > security s; > s.authEncryption (ae); > > MSM msm; > msm.security (s); > > wlprofile.MSM (msm); > > Boris > From Alex.Jakes at acis.uk.com Tue Apr 21 10:02:39 2009 From: Alex.Jakes at acis.uk.com (Alex Jakes) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] Missing types that seem to be imported correctly. Multiple import problem? Message-ID: <3B6FFDD1C5CC314C9C191EE32F41CE791EC6B116E7@camexsvr01.acis.local> Hello, I am currently evaluating if XSD will be able to work with a new schema that is currently being developed. I am not developing it myself but am able to make suggestions for changes. At the moment I am hitting a wall with a problem where several types from an imported namespace are not found by xsd when I compile. Initially I thought it was down to multiple imports into the same namespace, which I know is not supported, however if I change the imports to import a top level file that includes all parts of the namespace I get the same errors. I am able to validate the schema using XMLSpy so I am wondering why XMLSpy thinks it is valid and XSD does not. Are there any issues related to namespace imports that I should be aware of? The schema I am using is not my own so I can't really post it out to the list. I have tried to replicate examples of the problem using my own schemas but have been unable to do so. Is it possible to mail the schema to you without posting it to the list? Any help would be greatly appreciated. Best regards, Alex Jakes. ________________________________ This email and the information it contains are confidential and may be privileged, if you have received this email in error please notify us immediately. You should not copy it for any purpose, or disclose its contents to any other person. Internet communications are not secure and therefore ACIS does not accept legal responsibility for the contents of this message as it has been transmitted over a public network. If you suspect the message may have been intercepted or amended, please call the sender. Registered office: ACIS House, 168 Cowley Road, Cambridge, CB4 0DL. Registered in England and Wales, Company Number 3039051 ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ From boris at codesynthesis.com Tue Apr 21 10:44:30 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] Missing types that seem to be imported correctly. Multiple import problem? In-Reply-To: <3B6FFDD1C5CC314C9C191EE32F41CE791EC6B116E7@camexsvr01.acis.local> References: <3B6FFDD1C5CC314C9C191EE32F41CE791EC6B116E7@camexsvr01.acis.local> Message-ID: Hi Alex, Alex Jakes writes: > I am able to validate the schema using XMLSpy so I am wondering why XMLSpy > thinks it is valid and XSD does not. Are there any issues related to > namespace imports that I should be aware of? I am not aware of any issues with imports in XSD though there are some under-specified parts in this area where XML Schema processors vary significantly. > The schema I am using is not my own so I can't really post it out to > the list. I have tried to replicate examples of the problem using my > own schemas but have been unable to do so. Is it possible to mail > the schema to you without posting it to the list? Yes, I would like to take a look. Please send it to me directly. Boris From sir.costy at gmail.com Tue Apr 21 11:11:31 2009 From: sir.costy at gmail.com (Constantin Iacobescu) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] iso-8859-1 - Serialization Error Message-ID: Hello, I try to create a xml.file .. to serialize using the XSD tree. The binding is created for parsing/serializing LandXML files. When I use the UTF-8 encoding anything is ok. The problem now is that I want serialize elements which are using Latin-1 character set. And now is the crash of the program in the file "streambuff" - exception: xsd::cxx::xml::invalid_utf8_string at memory location 0x0017b492. Also I use VC9 and Windows Vista The Xercesc library is compiled statical and with Multi Byte Character Set option. To understand better here is the code used: /////////////////////////////////////////////////////////////// XMLPlatformUtils::Initialize (); try { std::ofstream ofs; ofs.exceptions (std::ios_base::badbit | std::ios_base::failbit); ofs.open (fileName); std::auto_ptr objLandXML ( new LandXML(xml_schema::Date(2008,4,20), xml_schema::Time(12, 34, 56), "1.2")); xml_schema::NamespaceInfomap infoMap; infoMap[""].name = "http://www.landxml.org/schema/LandXML-1.2"; infoMap[""].schema = " http://www.landxml.org/schema/LandXML-1.2/LandXML-1.2.xsd"; LandXML::ProjectSequence& projectSequence(objLandXML.getProject()); Project project("Project"); project.setDesc("???"); // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! HERE IS THE PROBLEM projectSequence.push_back(project); serializeLandXML (ofs, *objLandXML, infoMap, "iso-8859-1", xml_schema::Flags::dont_initialize); // !!!!!!!!!!!!!!!!!!!!!!! APPLICATION CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } catch (const xml_schema::Exception& e) { assert(false); } XMLPlatformUtils::Terminate (); /////////////////////////////////////////////////////////////// If anybody has had the same problem or know how to do this would be appreciate. Thanks. Best Regards, Constantin Iacobescu From dante.aureon at gmail.com Wed Apr 22 04:37:39 2009 From: dante.aureon at gmail.com (=?ISO-8859-1?Q?Rub=E9n_Mart=EDnez?=) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] Problem with a GML parsing Message-ID: <58889aa30904220137i14c562c8k7a947a4b7ca67a0a@mail.gmail.com> Hi! I have a problem with a parser GML files, a small gml file with CityGML code. I reed the manually for parsing, and other posts in the mailing list about the same problem, but I dont search any help for my application I need to parser a file in a Object, mi app. compile an execute correctly, but my object that I need is empty!!! And I dont know because exists this problem. I use the examples in the codesynthesis manual and some examples for other users. My piece of code: *try { log << "Parsing file " << file << std::endl; /* File is a parameter for the actual method */ auto_ptr r (core::CityModel(file)); <-- HERE IS THE PROBLEM i Know. log << "File parsed with success !" << std::endl; core::CityModelType::_GenericApplicationPropertyOfCityModel_iterator iterator_begin, iterator_end; core::CityModelType::_GenericApplicationPropertyOfCityModel_sequence seqCity = r->_GenericApplicationPropertyOfCityModel(); iterator_begin = seqCity.begin(); iterator_end = seqCity.end(); for (;iterator_begin!=iterator_end;iterator_begin++){ if ( gml::FeaturePropertyType* fpt = dynamic_cast (&(*iterator_begin))) { // FeaturePropertyType fpt. }else { // No es. } <<<------------------- This code non execute } catch (const xml_schema::exception& e) { log << "Error parsing file !" << std::endl; log << e << std::endl; log.close(); } log.close(); * Anyone can help my with this problem??? Any same the same or similar trouble??? Thanks a lot!!!! Thanks!!! -- ------------------------------------------------ Rub?n Mart?nez Garc?a From sir.costy at gmail.com Wed Apr 22 04:47:19 2009 From: sir.costy at gmail.com (Constantin Iacobescu) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] iso-8859-1 - Parsing issue Message-ID: Hi Boris, I try to parse a xml file which use the iso-8859-1 (Latin-1) char encoding and all I get are some strange characters. How I am new on the xml world I don't know where I am doin wrong. Don't know if have something to do with the Xerces compilation or with XSD binding or the character set use by the VC projects. More in detail: - I compiled the Xerces like a Statical Library and the VC proj char set was "Use Multi-Byte Character" - I used the binding code to create my one library, VC proj char set was "Use Multi-Byte Character" - I use this library in a project which is also VC proj char set "Use Multi-Byte Character" how it doe not work I have changed the VC project Character Set of all the projects to "Not Set" and still get wrong characters. Don't know if I need and if so, if is any way to tell to Xerces what char set must use. I had thought that the character set of the parser is get automatically from the xml element named "encoding". The code is veri simple as you can see here: ///////////////////////////////////////////////////////////////// XMLPlatformUtils::Initialize (); try { std::auto_ptr objLandXML ( parseLandXML(fileName.c_str(), xml_schema::Flags::dont_initialize)); LandXML::ProjectSequence projectSequence(objLandXML.getProject()); for (LandXML::ProjectConstIterator projectIterator(projectSequence.begin()); projectIterator != projectSequence.end (); ++projectIterator) Project::NameType doTest = projectIterator->getName(); // !!!!!!!!!!! And here if the char in the xml file are using the iso-8859-1 get wrong } catch (const xml_schema::Parsing& e) { assert(false); } catch (const xml_schema::Exception& e) { assert(false); } XMLPlatformUtils::Terminate (); ///////////////////////////////////////////////////////////////// to get a clue on how the xml file looks I put here a snippet: ********************************************************* ********************************************************** Thanks and Regards, Constantin Iacobescu From boris at codesynthesis.com Wed Apr 22 06:09:11 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] iso-8859-1 - Serialization Error In-Reply-To: References: Message-ID: Hi Constantin, Constantin Iacobescu writes: > exception: xsd::cxx::xml::invalid_utf8_string > > [...] > > > project.setDesc("???"); When you use char as the character type (default), the text in the object model is expected to be in UTF-8. What happens here is you pass a string containing characters that are in another encoding (ISO-8859-1) and which happen to be invalid in UTF-8. That's why you get the invalid_utf8_string exception during serialization. One thing that you can try (apart from converting your strings to UTF-8) is to recompile your application with the XSD_USE_LCP macro defined which will make the object model assume text is in the local code page. What that means exactly depends on the operating system. See Q&A 1.2 in the C++/Tree Mapping FAQ for details: http://wiki.codesynthesis.com/Tree/FAQ Boris From boris at codesynthesis.com Wed Apr 22 06:23:46 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] Problem with a GML parsing In-Reply-To: <58889aa30904220137i14c562c8k7a947a4b7ca67a0a@mail.gmail.com> References: <58889aa30904220137i14c562c8k7a947a4b7ca67a0a@mail.gmail.com> Message-ID: Hi Rub?n, Rub?n Mart?nez writes: > I have a problem with a parser GML files, a small gml file with CityGML > code. It is a good idea to show us the file (no need to send the schema; it is publicly available). > I need to parser a file in a Object, mi app. compile an execute correctly, > but my object that I need is empty! I assume you compiled all your schemas with the --generate-polymorphic option. > core::CityModelType::_GenericApplicationPropertyOfCityModel_sequence > seqCity = r->_GenericApplicationPropertyOfCityModel(); Use a reference instead of making a copy: core::CityModelType::_GenericApplicationPropertyOfCityModel_sequence& seqCity = r->_GenericApplicationPropertyOfCityModel(); > if ( gml::FeaturePropertyType* fpt = > dynamic_cast (&(*iterator_begin))) > { > // FeaturePropertyType fpt. > }else { > // No es. > } <<<------------------- This code non execute Which branch is executing? It is also hard to say which one should without seeing the XML file. Boris From dante.aureon at gmail.com Wed Apr 22 06:39:07 2009 From: dante.aureon at gmail.com (=?ISO-8859-1?Q?Rub=E9n_Mart=EDnez?=) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] Problem with a GML parsing In-Reply-To: References: <58889aa30904220137i14c562c8k7a947a4b7ca67a0a@mail.gmail.com> Message-ID: <58889aa30904220339u538deee8ja01458e6d1a1bddc@mail.gmail.com> Thanks a lot!!! I resolve the problem using an acces to the content of the CityModelType with other variable, similar to this: this smal piece of code insert after the file parsing, and then the code *Model = *r; Is strange this code, but runs, now I work in the problem more because this solution it`s rare. Atend your questions, I compile with the option generate polimorphic, and the other, Any branch executed, the debugger shows that the object r are empty. With this simple solution the problem solvented temporary. Thanks a lot!!! Ruben El 22 de abril de 2009 12:23, Boris Kolpackov escribi?: > Hi Rub?n, > > Rub?n Mart?nez writes: > > > I have a problem with a parser GML files, a small gml file with CityGML > > code. > > It is a good idea to show us the file (no need to send the schema; it is > publicly available). > > > > I need to parser a file in a Object, mi app. compile an execute > correctly, > > but my object that I need is empty! > > I assume you compiled all your schemas with the --generate-polymorphic > option. > > > > core::CityModelType::_GenericApplicationPropertyOfCityModel_sequence > > seqCity = r->_GenericApplicationPropertyOfCityModel(); > > Use a reference instead of making a copy: > > core::CityModelType::_GenericApplicationPropertyOfCityModel_sequence& > seqCity = r->_GenericApplicationPropertyOfCityModel(); > > > if ( gml::FeaturePropertyType* fpt = > > dynamic_cast (&(*iterator_begin))) > > { > > // FeaturePropertyType fpt. > > }else { > > // No es. > > } <<<------------------- This code non execute > > Which branch is executing? It is also hard to say which one should > without seeing the XML file. > > Boris > From boris at codesynthesis.com Wed Apr 22 06:39:21 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] Problem with a GML parsing In-Reply-To: <58889aa30904220339u538deee8ja01458e6d1a1bddc@mail.gmail.com> References: <58889aa30904220137i14c562c8k7a947a4b7ca67a0a@mail.gmail.com> <58889aa30904220339u538deee8ja01458e6d1a1bddc@mail.gmail.com> Message-ID: Hi Rub?n, I didn't understand any of what you said, but I am glad it is working now ;-). Boris From boris at codesynthesis.com Wed Apr 22 07:50:03 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] iso-8859-1 - Serialization Error In-Reply-To: References: Message-ID: Hi Constantin, CC'ed xsd-users; see rule #1 in posting guidelines: http://www.codesynthesis.com/support/posting-guidelines.xhtml Constantin Iacobescu writes: > You have right, but > I thought that the function > serializeLandXML (ofs, > *objLandXML, > infoMap, > "iso-8859-1", //"UTF-8", > xml_schema::Flags::dont_initialize > ); > > is also changing the dom encoding. > > my app is not supporting yet unicode string, so the other question is > How can I tell to the parser what encoding should use? > I want to set the encoding used for serialization from default to ISO-8859-1 > but unfortunately I don't know how to do that. ina a very simple way. You are confusing several things here. There can be three unrelated encodings involved in parsing, accessing/modifying, and serializing XML with XSD. These are: 1. Character encoding in the document being parsed. This is specified in the XML document. 2. Character encoding in the object model. As we have already discussed, when char is used as the character type, it is UTF-8 by default and can be changed to "local code page" with the XSD_USE_LCP macro. 3. Character encoding in the document being serialized. This is specified in the serialization function. It is perfectly normal for all three to be different. For example, the document you want to parse is in ISO-8859-1, the object model encoding is UTF-8, and you serialize the document in UTF-16. When the document is parsed, the generated code automatically converts the data from the document encoding (1) to the object model encoding (2). Similarly, when the document is serialized, the data is converted from the object model encoding (2) to the output document encoding (3). Boris From sir.costy at gmail.com Wed Apr 22 09:13:17 2009 From: sir.costy at gmail.com (Constantin Iacobescu) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] iso-8859-1 - Serialization Error In-Reply-To: References: Message-ID: Hello, The recompile application with the XSD_USE_LCP macro defined seams to solve the problem. Thanks On Wed, Apr 22, 2009 at 1:50 PM, Boris Kolpackov wrote: > Hi Constantin, > > CC'ed xsd-users; see rule #1 in posting guidelines: > > http://www.codesynthesis.com/support/posting-guidelines.xhtml > > Constantin Iacobescu writes: > > > You have right, but > > I thought that the function > > serializeLandXML (ofs, > > *objLandXML, > > infoMap, > > "iso-8859-1", //"UTF-8", > > xml_schema::Flags::dont_initialize > > ); > > > > is also changing the dom encoding. > > > > my app is not supporting yet unicode string, so the other question is > > How can I tell to the parser what encoding should use? > > I want to set the encoding used for serialization from default to > ISO-8859-1 > > but unfortunately I don't know how to do that. ina a very simple way. > > You are confusing several things here. There can be three unrelated > encodings involved in parsing, accessing/modifying, and serializing > XML with XSD. These are: > > 1. Character encoding in the document being parsed. This is specified > in the XML document. > > 2. Character encoding in the object model. As we have already discussed, > when char is used as the character type, it is UTF-8 by default and > can be changed to "local code page" with the XSD_USE_LCP macro. > > 3. Character encoding in the document being serialized. This is specified > in the serialization function. > > It is perfectly normal for all three to be different. For example, the > document you want to parse is in ISO-8859-1, the object model encoding > is UTF-8, and you serialize the document in UTF-16. > > When the document is parsed, the generated code automatically converts > the data from the document encoding (1) to the object model encoding (2). > Similarly, when the document is serialized, the data is converted from > the object model encoding (2) to the output document encoding (3). > > Boris > -- Constantin Iacobescu From boris at codesynthesis.com Wed Apr 22 06:12:50 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] iso-8859-1 - Parsing issue In-Reply-To: References: Message-ID: Hi Constantin, Constantin Iacobescu writes: > Project::NameType doTest = projectIterator->getName(); > // And here if the char in the xml file are using the iso-8859-1 get wrong Same story as in "ISO-8859-1 - Serialization Error"[1]. You expect the text in the object model to be in ISO-8859-1 while it is in UTF-8. [1] http://www.codesynthesis.com/pipermail/xsd-users/2009-April/002312.html Boris From sir.costy at gmail.com Wed Apr 22 09:13:48 2009 From: sir.costy at gmail.com (Constantin Iacobescu) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] iso-8859-1 - Parsing issue In-Reply-To: References: Message-ID: Hello, The recompile application with the XSD_USE_LCP macro defined seams to solve the problem too. Thanks On Wed, Apr 22, 2009 at 12:12 PM, Boris Kolpackov wrote: > Hi Constantin, > > Constantin Iacobescu writes: > > > Project::NameType doTest = projectIterator->getName(); > > // And here if the char in the xml file are using the iso-8859-1 get > wrong > > Same story as in "ISO-8859-1 - Serialization Error"[1]. You expect the > text in the object model to be in ISO-8859-1 while it is in UTF-8. > > [1] > http://www.codesynthesis.com/pipermail/xsd-users/2009-April/002312.html > > Boris > -- Constantin Iacobescu From thagen at slb.com Mon Apr 27 04:26:22 2009 From: thagen at slb.com (Tore Martin Hagen) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] I want to ignore Unknown element Message-ID: <49F56C2E.5050108@oslo.westerngeco.slb.com> Hi. Is there a way I can tell the parser to just ignore all unknown tags as if they where not there? I have tried to add my own xml_schema::error_handler and returning true. When logging in my own error handler I see this id= line=9 column=34 sev=ERROR msg=Unknown element 'softwareImageConfigFile' id= line=10 column=26 sev=ERROR msg=Element 'softwareImageConfigFile' is not valid for content model: '(network,dsnSubnet)' And then it thows an exception which I assume comes from the DOMErrorHandler. I have tried to add the flag xml_schema::flags::dont_validate and in this case the unknown element is ignored, but if I have an other error like unknown enum value my application crashes which is not so good. Regards Tore Martin Hagen From boris at codesynthesis.com Mon Apr 27 04:43:34 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] I want to ignore Unknown element In-Reply-To: <49F56C2E.5050108@oslo.westerngeco.slb.com> References: <49F56C2E.5050108@oslo.westerngeco.slb.com> Message-ID: Hi, Tore Martin Hagen writes: > Is there a way I can tell the parser to just ignore all unknown tags as > if they where not there? > > I have tried to add my own xml_schema::error_handler and returning true. > When logging in my own error handler I see this > id= line=9 column=34 sev=ERROR msg=Unknown element 'softwareImageConfigFile' > id= line=10 column=26 sev=ERROR msg=Element 'softwareImageConfigFile' is > not valid for content model: '(network,dsnSubnet)' > > And then it thows an exception which I assume comes from the > DOMErrorHandler. > > I have tried to add the flag xml_schema::flags::dont_validate and in > this case the unknown element is ignored, but if I have an other error > like unknown enum value my application crashes which is not so good. There is no way to selectively disable certain aspects of XML Schema validation (which is more or less what you are asking for). You best bet is to "relax" the schema to allow unknown elements (via the xs:any wildcard) in some places where you expect them to appear. For example, if you have: Then you can change it to: Which will allow any elements after network and dnsSubnet. Boris From angelo at cedeo.net Mon Apr 27 05:18:09 2009 From: angelo at cedeo.net (Angelo Difino) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] Keep a xsd library small In-Reply-To: References: <499469A3.5020609@cedeo.net> <49B0FBE1.9060201@cedeo.net> Message-ID: <49F57851.6040802@cedeo.net> Hi Boris and all, I still keep working hard on the xsd-types of the schemes i've sent you on the 12nd of February. I've some troubles since in the first release i forgot (me damn it! ;) ) to include the specifier "--generate-wildcard" since i've several tags include the any-type. for example the DIDL.xsd include an any tag for the structured data type: didl.xsd -> StatementType -> didl-msx -> MetadataType -> StructuredDataType -> when i need to simply assign (clone) an ItemType (that include the above structured data type) i've a run-time xerces error on the wildcard-source.txx: // Get an implementation of the Load-Store (LS) interface. // xercesc::DOMImplementation* impl ( xercesc::DOMImplementationRegistry::getDOMImplementation (ls)); return xml::dom::auto_ptr ( impl->createDocument ()); Am I missing somethins ? I'm checking your documentation but i really wondering if now (that i've added the "--generate-wildcard"), i need to implement / wrote some code some where to "help" xerces when it founds an any type... (the error is throwed in a place that i cannot manage) The code that throw the error is: std::auto_ptr< DIDLType > tmp = DIDL(filename.c_str() , (validate ? 0 : xml_schema::flags::dont_validate) ); mxm_dataobject::schema::didl::ItemType& topelement = dynamic_cast(_didl->Item()); mxm_dataobject::schema::didl::ItemType secondelement=topelement; (in a inner class) Thank you very much for the attention, Best regards, Angelo Boris Kolpackov wrote: > Hi Angelo, > > Angelo Difino writes: > > >> Last question :) since the number of classes is quite big (about 800), >> I've decided to organize this source code in several subfolders, labelled >> with the same name of the schema they belong to. >> >> I've wrote a batch file that simply move the files in the correct >> subfolder. Is there any way to automatize it (something like "--output-dir >> dir", but for the different namespaces)? >> > > Take a look a the --type-file-regex and --type-file-regex-trace > options in the XSD Compiler Command Line Manual: > > http://www.codesynthesis.com/projects/xsd/documentation/xsd.xhtml > > The first option allows you to specify regular expressions that > are used to transform type names into file names. They are run > on a string that includes the namespace. While you won't be able > to automatically place such files into different directories with > this approach, you can add a namespace-specific prefix to the files > and maybe later move them into a directory corresponding to the > namespace with a simple(r) script. > > > >> I've included in attach an example ... >> > > You attachment is in the RAR format. Please see item #5 in the > Posting Guidelines regarding this: > > http://www.codesynthesis.com/support/posting-guidelines.xhtml > > Boris > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.0.237 / Virus Database: 270.11.8/1987 - Release Date: 03/06/09 07:20:00 > > From boris at codesynthesis.com Mon Apr 27 06:38:01 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] Keep a xsd library small In-Reply-To: <49F57851.6040802@cedeo.net> References: <499469A3.5020609@cedeo.net> <49B0FBE1.9060201@cedeo.net> <49F57851.6040802@cedeo.net> Message-ID: Hi Angelo, Angelo Difino writes: > Hi Boris and all, > I still keep working hard on the xsd-types of the schemes i've sent you > on the 12nd of February. > > I've some troubles since in the first release i forgot (me damn it! ;) ) > to include the specifier "--generate-wildcard" > since i've several tags include the any-type. for example the DIDL.xsd > include an any tag for the structured data > type: > > didl.xsd -> StatementType -> > didl-msx -> MetadataType -> StructuredDataType -> > > > > > when i need to simply assign (clone) an ItemType (that include the above > structured data type) > i've a run-time xerces error on the wildcard-source.txx: > > // Get an implementation of the Load-Store (LS) interface. > // > xercesc::DOMImplementation* impl ( > xercesc::DOMImplementationRegistry::getDOMImplementation (ls)); > > return xml::dom::auto_ptr ( > impl->createDocument ()); > > Am I missing somethins ? I'm checking your documentation but i really > wondering if now (that i've added the > "--generate-wildcard"), i need to implement / wrote some code some where > to "help" xerces when it founds an any type... You need to initialize the Xerces-C++ runtime. From Section 2.12, "Mapping for any and anyAttribute" in the C++/Tree Mapping User Manual: "For the XML Schema any and anyAttribute wildcards an optional mapping can be requested with the --generate-wildcard option. The mapping represents the content matched by wildcards as DOM fragments. Because the DOM API is used to access such content, the Xerces-C++ runtime should be initialized by the application prior to parsing and should remain initialized for the lifetime of objects with the wildcard content. For more information on the Xerces-C++ runtime initialization see Section 3.1, "Initializing the Xerces-C++ Runtime"." > The code that throw the error is: > > std::auto_ptr< DIDLType > tmp = DIDL(filename.c_str() , (validate ? 0 : > xml_schema::flags::dont_validate) ); > mxm_dataobject::schema::didl::ItemType& topelement = > dynamic_cast(_didl->Item()); > mxm_dataobject::schema::didl::ItemType secondelement=topelement; (in > a inner class) The above code should be something along these lines: #include int main () { xercesc::XMLPlatformUtils::Initialize (); { std::auto_ptr< DIDLType > tmp = DIDL(filename.c_str(), (validate ? 0 : xml_schema::flags::dont_validate | xml_schema::flags::dont_initialize) ); mxm_dataobject::schema::didl::ItemType& topelement = dynamic_cast(_didl->Item()); mxm_dataobject::schema::didl::ItemType secondelement=topelement; } xercesc::XMLPlatformUtils::Terminate (); } Notice that I've added the dont_initialize flag to the parsing function call. Boris From bhartsb at gmail.com Wed Apr 29 04:50:29 2009 From: bhartsb at gmail.com (B Hart) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] XSD and VC8 issues Message-ID: <661f825d0904290150u30be4982ta476a18a3108e4e3@mail.gmail.com> I have a need to use XSD for reading/writing C++ object configuration files as XML. I am having issues just getting a very simple XML file to read in. Hopefully someone can help. Here are the steps I've followed: 1. downloaded XSD, installed it, created a very simple xsd schema following the example in cxx-tree-guide.pdf, and then generated with XSD two files test.hxx and text.cxx. 2. incorporated test.hxx and test.cxx into a MSVC 2005 (VC 8) built project. In doing so I included the xercesc include folders, and xerces-c_3.lib which i located in the XSD distribution. ( Note, I downloaded xercesc and built it as a static library but then found the xerces-c_3.lib in the folders that XSD installed to. I noted that the xerces-c_3.lib provided with the XSD installation is much smaller than the xerces-c_3.lib that I compiled. I used the XSD version.) I added the appropriate include and .lib entries in the project properties. 3. I then try to read the simple XML file which was provided in cxx-tree-guide.pdf. In doing so I get: Access violation writing location 0x00438830. Unhandled exception at 0x00414994 in testXML.exe and break at the following line in the debugger: auto_ptr(auto_ptr_ref<_Ty> _Right) _THROW0() { // construct by assuming pointer from _Right auto_ptr_ref _Ty **_Pptr = (_Ty **)_Right._Ref; _Ty *_Ptr = *_Pptr; break is here---> *_Pptr = 0; // release old _Myptr = _Ptr; // reset this } the DLL is in the folder and I also tried the static lib but got linker issues. Some simple instructions for VC8 for doing a test project would be greatly welcome. Thanks. From boris at codesynthesis.com Wed Apr 29 05:49:08 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] XSD and VC8 issues In-Reply-To: <661f825d0904290150u30be4982ta476a18a3108e4e3@mail.gmail.com> References: <661f825d0904290150u30be4982ta476a18a3108e4e3@mail.gmail.com> Message-ID: Hi, B Hart writes: > In doing so I included the xercesc include folders, and xerces-c_3.lib > which i located in the XSD distribution. ( Note, I downloaded xercesc > and built it as a static library but then found the xerces-c_3.lib > in the folders that XSD installed to. I noted that the xerces-c_3.lib > provided with the XSD installation is much smaller than the xerces-c_3.lib > that I compiled. I used the XSD version.) The reason xerces-c_3.lib that comes with XSD is much smaller is because it is just an import library for the DLL while your static xerces-c_3.lib contains all the code. > Access violation writing location 0x00438830. Can you try to copy the parsing code from examples/cxx/tree/hello/driver.cxx and see if that works. Alternatively, you can send me your test project so that I can take a look (just the schema, XML file, and test driver, no generated or object code please). > I also tried the static lib but got linker issues. If you are linking to a static Xerces-C++ library, then you need to compile your application with the XERCES_STATIC_LIBRARY macro defined, as mentioned in the Xerces-C++ build instructions: http://xerces.apache.org/xerces-c/build-3.html#Windows Boris From jeffrey.yu at panpacificinvestment.com Wed Apr 29 11:51:16 2009 From: jeffrey.yu at panpacificinvestment.com (Jeffrey Yu) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] can xsd compile schema its structure includes reference to external schema? Message-ID: <005d01c9c8e2$55089640$ff19c2c0$%yu@panpacificinvestment.com> Hi I run into this problem and hope I can get some help here. In order to simplify the schema structure, I am looking to break the schema into three pieces: Product.xsd, Person.xsd, and Company.xsd. By doing this, I can reuse types defined inside of Product.xsd, for instance, individually in other applications. I got following error messages when compiling these xsd: Product.xsd:5:46: error: unable to map XML Schema namespace 'http://www.product.org' to C++ namespace Product.xsd:5:46: info: use the --namespace-map or --namespace-regex option to provide custom mapping Person.xsd:5:46: error: unable to map XML Schema namespace 'http://www.person.org' to C++ namespace Person.xsd:5:46: info: use the --namespace-map or --namespace-regex option to provide custom mapping Company.xsd:7:48: error: unable to map XML Schema namespace 'http://www.company.org' to C++ namespace Company.xsd:7:48: info: use the --namespace-map or --namespace-regex option to provide custom mapping On the command line, I have: $(XSD_DIR)\bin\xsd cxx-tree --root-element Product --generate-serialization --guard-prefix p Product.xsd $(XSD_DIR)\bin\xsd cxx-tree --root-element Person --generate-serialization --guard-prefix p Person.xsd $(XSD_DIR)\bin\xsd cxx-tree --root-element Company --generate-serialization --guard-prefix p Company.xsd Can someone let me know if this is doable with this xsd? Thanks! -------------- next part -------------- A non-text attachment was scrubbed... Name: Product.xsd Type: application/xml Size: 385 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20090429/81007cf8/Product.xml -------------- next part -------------- A non-text attachment was scrubbed... Name: Company.xml Type: text/xml Size: 391 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20090429/81007cf8/Company.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Company.xsd Type: application/xml Size: 856 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20090429/81007cf8/Company.xml -------------- next part -------------- A non-text attachment was scrubbed... Name: Person.xsd Type: application/xml Size: 432 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20090429/81007cf8/Person.xml From boris at codesynthesis.com Wed Apr 29 12:09:47 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] can xsd compile schema its structure includes reference to external schema? In-Reply-To: <005d01c9c8e2$55089640$ff19c2c0$%yu@panpacificinvestment.com> References: <005d01c9c8e2$55089640$ff19c2c0$%yu@panpacificinvestment.com> Message-ID: Hi Jeffrey, Jeffrey Yu writes: > Can someone let me know if this is doable with this xsd? Yes, this is doable. You just need to tell XSD how to map your new XML namespaces to C++ namespaces. For example, you can add the following options to the respective command lines: --namespace-map http://www.product.org=product --namespace-map http://www.person.org=person --namespace-map http://www.company.org=company Which will make XSD place the generated code into product, person, and company C++ namespaces, respectively. Or, you can generate everything into the global namespace (this is what you probably had before the split): --namespace-map http://www.product.org= --namespace-map http://www.person.org= --namespace-map http://www.company.org= See Section 3.3, "Namespace Mapping" in the C++/Tree Mapping Getting Started Guide for more information: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#3.3 Boris From jeffrey.yu at panpacificinvestment.com Wed Apr 29 12:32:58 2009 From: jeffrey.yu at panpacificinvestment.com (Jeffrey Yu) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] can xsd compile schema its structure includes reference to external schema? In-Reply-To: References: <005d01c9c8e2$55089640$ff19c2c0$%yu@panpacificinvestment.com> Message-ID: <000001c9c8e8$28019510$7804bf30$%yu@panpacificinvestment.com> Thanks Boris, thanks for the quick response. I did what you recommended, the first two went through ok. I got this when compiling "company.xsd", which makes reference to both product.xsd and person.xsd. This is the message I get: Person.xsd:5:46: error: unable to map XML Schema namespace 'http://www.person.org' to C++ namespace Person.xsd:5:46: info: use the --namespace-map or --namespace-regex option to provide custom mapping I couldn't tell if there are problems in person.xsd as far as the structure is concerned. My guess is Company is unable to locate Person.xsd, or simply something else? Thanks again. -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Wednesday, April 29, 2009 12:10 PM To: Jeffrey Yu Cc: XSD-users Subject: Re: [xsd-users] can xsd compile schema its structure includes reference to external schema? Hi Jeffrey, Jeffrey Yu writes: > Can someone let me know if this is doable with this xsd? Yes, this is doable. You just need to tell XSD how to map your new XML namespaces to C++ namespaces. For example, you can add the following options to the respective command lines: --namespace-map http://www.product.org=product --namespace-map http://www.person.org=person --namespace-map http://www.company.org=company Which will make XSD place the generated code into product, person, and company C++ namespaces, respectively. Or, you can generate everything into the global namespace (this is what you probably had before the split): --namespace-map http://www.product.org= --namespace-map http://www.person.org= --namespace-map http://www.company.org= See Section 3.3, "Namespace Mapping" in the C++/Tree Mapping Getting Started Guide for more information: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#3.3 Boris From boris at codesynthesis.com Wed Apr 29 12:32:30 2009 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] can xsd compile schema its structure includes reference to external schema? In-Reply-To: <000001c9c8e8$28019510$7804bf30$%yu@panpacificinvestment.com> References: <005d01c9c8e2$55089640$ff19c2c0$%yu@panpacificinvestment.com> <000001c9c8e8$28019510$7804bf30$%yu@panpacificinvestment.com> Message-ID: Hi Jeffrey, Jeffrey Yu writes: > I got this when compiling "company.xsd", which makes reference to both > product.xsd and person.xsd. Ok, then you need to use all three --namespace-map options when compiling this schema. Or, you can place all three in a file (one option per line) and then "include" it into the three command lines with the --options-file option. Boris From jeffrey.yu at panpacificinvestment.com Wed Apr 29 13:17:47 2009 From: jeffrey.yu at panpacificinvestment.com (Jeffrey Yu) Date: Sun Oct 11 15:34:09 2009 Subject: [xsd-users] can xsd compile schema its structure includes reference to external schema? In-Reply-To: References: <005d01c9c8e2$55089640$ff19c2c0$%yu@panpacificinvestment.com> <000001c9c8e8$28019510$7804bf30$%yu@panpacificinvestment.com> Message-ID: <000101c9c8ee$6acd9780$4068c680$%yu@panpacificinvestment.com> It works. Thanks! -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Wednesday, April 29, 2009 12:33 PM To: Jeffrey Yu Cc: 'XSD-users' Subject: Re: [xsd-users] can xsd compile schema its structure includes reference to external schema? Hi Jeffrey, Jeffrey Yu writes: > I got this when compiling "company.xsd", which makes reference to both > product.xsd and person.xsd. Ok, then you need to use all three --namespace-map options when compiling this schema. Or, you can place all three in a file (one option per line) and then "include" it into the three command lines with the --options-file option. Boris