From kashokshenoy at gmail.com Mon Jul 1 06:13:02 2013 From: kashokshenoy at gmail.com (Ashok Shenoy) Date: Mon Jul 1 06:13:10 2013 Subject: [xsd-users] schema to c++ namespace mapping problem Message-ID: Hello All, I have a .xsd file - PROTO-ASDCP-AM-20040311.xsd under the namespace: http://www.digicine.com/PROTO-ASDCP-AM-20040311# yes there is a '#' at the end of the namespace! how can I do a --namespace-map for the same to a c++ namespace? please help ... stuck here since ages! thanks in advance. regards, Ashok Shenoy, NEWBIE! From boris at codesynthesis.com Tue Jul 2 03:43:09 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jul 2 03:43:15 2013 Subject: [xsd-users] schema to c++ namespace mapping problem In-Reply-To: References: Message-ID: Hi Ashok, Ashok Shenoy writes: > under the namespace: http://www.digicine.com/PROTO-ASDCP-AM-20040311# > > yes there is a '#' at the end of the namespace! > > how can I do a --namespace-map for the same to a c++ namespace? I think the XSD compiler command line manual (man pages) has a pretty good description of this option and even an example: http://www.codesynthesis.com/projects/xsd/documentation/xsd.xhtml On Linux/UNIX you need to quote the option value because of the '#' character: --namespace-map 'http://www.digicine.com/PROTO-ASDCP-AM-20040311#=my_ns' Boris From kashokshenoy at gmail.com Tue Jul 2 21:47:23 2013 From: kashokshenoy at gmail.com (Ashok Shenoy) Date: Tue Jul 2 21:47:30 2013 Subject: [xsd-users] schema to c++ namespace mapping problem In-Reply-To: References: Message-ID: Thanks Boris, It turned out that I had not given options in the proper order during XSD compilation. Everything is fine in .XSD compilation now. However, once I have generated the .cxx files and compiled to an executable, While the executable evaluates the schemas for .XML binding, I get the following error: :0:0 error: unable to open file ' http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd' Here is a copy of my command line for xsd schema processing and options file: xsdcxx cxx-tree --options-file options.cfg PROTO-ASDCP-AM-20040311.xsd PROTO-ASDCP-CPL-20040511.xsd PROTO-ASDCP-PKL-20040311.xsd xmldsig-core-schema.xsd xml.xsd --namespace-map http://www.w3.org/XML/1998/namespace=xml_ns --namespace-map http://www.w3.org/2000/09/xmldsig#=xmldsig_ns --location-map http://www.w3.org/2001/XMLSchema.dtd=XMLSchema.dtd --location-map http://www.w3.org/2001/03/xml.xsd=xml.xsd --location-map http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd=xmldsig-core-schema.xsd --namespace-map http://www.digicine.com/PROTO-ASDCP-PKL-20040311#=pkl_ns --namespace-map http://www.digicine.com/PROTO-ASDCP-CPL-20040511#=cpl_ns --namespace-map http://www.digicine.com/PROTO-ASDCP-AM-20040311#=am_ns --location-map http://www.digicine.com/PROTO-ASDCP-PKL-20040311.xsd=PROTO-ASDCP-PKL-20040311.xsd --location-map http://www.digicine.com/PROTO-ASDCP-CPL-20040511.xsd=PROTO-ASDCP-CPL-20040511.xsd --location-map http://www.digicine.com/PROTO-ASDCP-AM-20040311.xsd=PROTO-ASDCP-AM-20040311.xsd this generates code, fine...which I then compile as follows: g++ *.cxx -I . -lxerces-c -o xml_validator this builds fine too...but when I run: ./xml_validator ASSETMAP_VALID.xml I get: :0:0 error: unable to open file ' http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd' http://www.digicine.com/PROTO-ASDCP-CPL-20040511.xsd:17:97 error: fatal error during schema scan What am I missing? regards, Ashok Shenoy. On Tue, Jul 2, 2013 at 1:13 PM, Boris Kolpackov wrote: > Hi Ashok, > > Ashok Shenoy writes: > > > under the namespace: http://www.digicine.com/PROTO-ASDCP-AM-20040311# > > > > yes there is a '#' at the end of the namespace! > > > > how can I do a --namespace-map for the same to a c++ namespace? > > I think the XSD compiler command line manual (man pages) has a > pretty good description of this option and even an example: > > http://www.codesynthesis.com/projects/xsd/documentation/xsd.xhtml > > On Linux/UNIX you need to quote the option value because of the '#' > character: > > --namespace-map 'http://www.digicine.com/PROTO-ASDCP-AM-20040311#=my_ns' > > Boris > From giuseppe500 at yahoo.it Tue Jul 2 15:17:51 2013 From: giuseppe500 at yahoo.it (giuseppe ferrari) Date: Wed Jul 3 06:42:36 2013 Subject: [xsd-users] xsd and member functions Message-ID: <1372792671.19590.YahooMailNeo@web171403.mail.ir2.yahoo.com> hello. my question is: is possible to add a simple member function to all generated types of xsd from an .xsd ? Because i wish use the visitor pattern for my purposes, then i must place a virtual function in my base class virtual void visit(CBaseVisitor * pVisit){ }; and in all derived classes i must add a function type::visit(CBaseVisitor* pVisitor) { ??? pVisitor->visit(this); } is possible with your xsd.exe? thanks. From turambar.telcontar at googlemail.com Wed Jul 3 04:49:24 2013 From: turambar.telcontar at googlemail.com (Lena) Date: Wed Jul 3 06:42:36 2013 Subject: [xsd-users] Generating Visitor accept-Methods Message-ID: <002d01ce77ca$392b20f0$ab8162d0$@gmail.com> Hi, Similarly to the question posted in this thread ( http://codesynthesis.com/pipermail/xsd-users/2009-July/002397.html), I'd like to generate an accept method automatically when using cxx-tree. Can you provide some hint on how to customize this? Currently, the only way I see is generating an entire -custom-type for all the nodes in my tree, then implementing it manually. But actually, I only wanted to implement the visitor itself manually, not the accept-methods as well. Thanks in advance Lena From boris at codesynthesis.com Wed Jul 3 09:13:00 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jul 3 09:13:07 2013 Subject: [xsd-users] schema to c++ namespace mapping problem In-Reply-To: References: Message-ID: Hi Ashok, Ashok Shenoy writes: > this builds fine too...but when I run: > > ./xml_validator ASSETMAP_VALID.xml I get: > > :0:0 error: unable to open file ' > http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd' > http://www.digicine.com/PROTO-ASDCP-CPL-20040511.xsd:17:97 error: fatal > error during schema scan Your XML file references a remote schema that cannot be opened. Generally, it is a bad idea to download schemas over the network for every XML parse (slow, unreliable, etc). It is better to pre-load and cache them as shown in the 'caching' example. Boris From boris at codesynthesis.com Wed Jul 3 09:23:32 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jul 3 09:23:39 2013 Subject: [xsd-users] xsd and member functions In-Reply-To: <1372792671.19590.YahooMailNeo@web171403.mail.ir2.yahoo.com> References: <1372792671.19590.YahooMailNeo@web171403.mail.ir2.yahoo.com> Message-ID: Hi Giuseppe, giuseppe ferrari writes: > is possible to add a simple member function to all generated types of > xsd from an .xsd? You can do that using the type customization support. It is not automatic, but possible. Maybe create a class template that "wraps" all generated classes and adds what you need. You would loose the constructors, but it is probably a small price to pay, especially if you don't need to create object models from scratch. For more information on type customization, see the C++/Tree Mapping Customization Guide: http://wiki.codesynthesis.com/Tree/Customization_guide As well as the examples in the examples/cxx/tree/custom/ directory. Boris From boris at codesynthesis.com Wed Jul 3 09:26:04 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jul 3 09:26:10 2013 Subject: [xsd-users] Generating Visitor accept-Methods In-Reply-To: <002d01ce77ca$392b20f0$ab8162d0$@gmail.com> References: <002d01ce77ca$392b20f0$ab8162d0$@gmail.com> Message-ID: Hi Lena, Lena writes: > I'd like to generate an accept method automatically when using cxx-tree. Is it a "visitor day" today? Two questions in a row about the same thing: http://codesynthesis.com/pipermail/xsd-users/2013-July/003994.html Boris From boris at codesynthesis.com Wed Jul 3 09:50:19 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jul 3 09:50:26 2013 Subject: [xsd-users] C++ 11 move semantics In-Reply-To: References: Message-ID: Hi Ovanes, Ovanes Markarian writes: > Do you plan to solve that issue in an upcoming release? I am not sure what the appropriate solution is for this case. Initially, I thought that always calling std::move() is the right approach, but now I am not so sure. For example, if the arg/ret type is an l-value reference (not likely but conceivable), then things will break. I definitely would prefer not to introduce a "move" function to the type map -- that thing is already complex/confusing enough. > Are there any plans for the upcoming release? Yes, currently end-Aug/mid-Sep. Boris From kashokshenoy at gmail.com Wed Jul 3 11:43:26 2013 From: kashokshenoy at gmail.com (Ashok Shenoy) Date: Wed Jul 3 11:43:33 2013 Subject: [xsd-users] schema to c++ namespace mapping problem In-Reply-To: References: Message-ID: Hello Boris, You will notice in the options.cfg file, I have mapped the xmldsig namespace properly. xsdcxx generates the source correctly and the source compiles too. The error comes at runtime.only for this file; WHY? Also the caching method involves accessing xerces directly. I do not want to do this. please advice. regards, Ashok Shenoy. On Wed, Jul 3, 2013 at 6:43 PM, Boris Kolpackov wrote: > Hi Ashok, > > Ashok Shenoy writes: > > > this builds fine too...but when I run: > > > > ./xml_validator ASSETMAP_VALID.xml I get: > > > > :0:0 error: unable to open file ' > > > http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd > ' > > http://www.digicine.com/PROTO-ASDCP-CPL-20040511.xsd:17:97 error: fatal > > error during schema scan > > Your XML file references a remote schema that cannot be opened. Generally, > it is a bad idea to download schemas over the network for every XML > parse (slow, unreliable, etc). It is better to pre-load and cache them > as shown in the 'caching' example. > > Boris > From om_codesynthesis at keywallet.com Wed Jul 3 12:13:07 2013 From: om_codesynthesis at keywallet.com (Ovanes Markarian) Date: Wed Jul 3 12:13:36 2013 Subject: [xsd-users] C++ 11 move semantics In-Reply-To: References: Message-ID: Boris, thanks for your answer! On Wed, Jul 3, 2013 at 3:50 PM, Boris Kolpackov wrote: > I am not sure what the appropriate solution is for this case. Initially, > I thought that always calling std::move() is the right approach, but now > I am not so sure. For example, if the arg/ret type is an l-value reference > (not likely but conceivable), then things will break. > Mmmm... In my case I just edited the generated code manually. IMO, std::move is not required. The only fix I'd propose is to get rid of the temporary l-value: MyType tmp = parser.do_what_ever(...); handle_value(tmp); If you just generate: handle_value(parser.do_what_ever(...)); Everything should be handled automatically (moved implicitly, since it is an r-value). Here the library puts the responsibility to the user to create compatible input/output types. In that case no explicit move call is needed. Or do I miss smth? Thanks, Ovanes From boris at codesynthesis.com Thu Jul 4 03:18:21 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jul 4 03:18:28 2013 Subject: [xsd-users] Issue using proxy for Open Packaging Conventions core-properties schema In-Reply-To: References: Message-ID: Hi Rob, Boris Kolpackov writes: > I am going to go ahead and fix it for the next release. Just a heads-up, the fix is in the repository. Let me know if you would like a pre-release binary. Boris From boris at codesynthesis.com Thu Jul 4 05:36:58 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jul 4 05:37:05 2013 Subject: [xsd-users] C++ 11 move semantics In-Reply-To: References: Message-ID: Hi Ovanes, Ovanes Markarian writes: > The only fix I'd propose is to get rid of the temporary l-value: > > MyType tmp = parser.do_what_ever(...); > handle_value(tmp); > > If you just generate: > > handle_value(parser.do_what_ever(...)); > > Everything should be handled automatically (moved implicitly, since it is > an r-value). Here the library puts the responsibility to the user to create > compatible input/output types. > > In that case no explicit move call is needed. Or do I miss smth? The reason we have a temporary in the first place is older/broken C++ compilers. For example, IBM xlC cannot pass std::auto_ptr without a named temporary. So what I did is add --std option which allows one to specify the C++ standard that the generated code should conform to. If you specify --std c++11, then the temporary is not generated. This fix is in the repository for the next release. Boris From om_codesynthesis at keywallet.com Thu Jul 4 07:07:15 2013 From: om_codesynthesis at keywallet.com (Ovanes Markarian) Date: Thu Jul 4 07:07:44 2013 Subject: [xsd-users] C++ 11 move semantics In-Reply-To: References: Message-ID: On Thu, Jul 4, 2013 at 11:36 AM, Boris Kolpackov wrote: > The reason we have a temporary in the first place is older/broken > C++ compilers. For example, IBM xlC cannot pass std::auto_ptr without > a named temporary. > > So what I did is add --std option which allows one to specify the > C++ standard that the generated code should conform to. If you > specify --std c++11, then the temporary is not generated. This > fix is in the repository for the next release. > Cool! That sounds like a good compromize ;) Just a minor suggestion and offtopic to that thread. auto_ptr was deprecated in C++11, so the c++11 flag should possibly use a unique_ptr instead? Thanks, Ovanes From boris at codesynthesis.com Thu Jul 4 09:16:35 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jul 4 09:16:43 2013 Subject: [xsd-users] C++ 11 move semantics In-Reply-To: References: Message-ID: Hi Ovanes, Ovanes Markarian writes: > auto_ptr was deprecated in C++11, so the c++11 flag should possibly > use a unique_ptr instead? Yes, that's still on the TODO list. Boris From boris at codesynthesis.com Thu Jul 4 09:18:51 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jul 4 09:18:57 2013 Subject: [xsd-users] schema to c++ namespace mapping problem In-Reply-To: References: Message-ID: Hi Ashok, Ashok Shenoy writes: > The error comes at runtime.only for this file; WHY? Becuase the C++/Tree mapping uses Xerces-C++ to perform schema validation. > Also the caching method involves accessing xerces directly. I do not want > to do this. Well, disable validation then. See Section 5.1, "XML Schema Validation and Searching" in the C++/Tree Mapping Getting Started Guide for details: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#5.1 Boris From kashokshenoy at gmail.com Thu Jul 4 09:49:57 2013 From: kashokshenoy at gmail.com (Ashok Shenoy) Date: Thu Jul 4 09:50:04 2013 Subject: [xsd-users] schema to c++ namespace mapping problem In-Reply-To: References: Message-ID: Hi Boris, Thanks for your help. I finally got things working. Heres what I did: 1 - mapped namespaces using --map-namespace 2 - updated the imports of the local schemas to point to my local .xsds 3 - set up schema location properties in the driver to point global URIs to local .xsds now it hums like a bee! Thanx. Ashok Shenoy. On Thu, Jul 4, 2013 at 6:48 PM, Boris Kolpackov wrote: > Hi Ashok, > > Ashok Shenoy writes: > > > The error comes at runtime.only for this file; WHY? > > Becuase the C++/Tree mapping uses Xerces-C++ to perform schema > validation. > > > > Also the caching method involves accessing xerces directly. I do not want > > to do this. > > Well, disable validation then. See Section 5.1, "XML Schema Validation > and Searching" in the C++/Tree Mapping Getting Started Guide for details: > > http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#5.1 > > Boris > From olitour at gmail.com Fri Jul 5 07:18:42 2013 From: olitour at gmail.com (Olivier Tournaire) Date: Fri Jul 5 07:18:50 2013 Subject: [xsd-users] (Generic) CityGML parsing Message-ID: Hi all, I am wondering if there is a way to parse ? CityGML file in a "generic" fashion. What I mean by "generic" is without any prior knowledge on th? file content. For instance, is there a way to iterate over all elements of a CityModelType, and for each of them, to iterate over all their sub-elements? All the classes generated with cxx-tree subclass at top-level xml_schema::type. Let me know of you need more details. Home you could help. Best regards Olivier From giuseppe500 at yahoo.it Fri Jul 5 05:40:21 2013 From: giuseppe500 at yahoo.it (giuseppe ferrari) Date: Fri Jul 5 07:54:32 2013 Subject: [xsd-users] (no subject) Message-ID: <1373017221.56325.YahooMailNeo@web171406.mail.ir2.yahoo.com> hello. I'm built the and compiled successfully the xsd sources. Now i wish understand how i can generate the c++ classes from xsd from the main function of my project. What classes i need to instantiate and how to use them? I'm Sorry but i'm not find documentation on this. I only compiled with doxygen the project for view the classes. thanks. For example what are the sources of the command line executable xsd.exe? How gets the command line parameters and how? generates the classes? where i can find some documentation on the sources? thanks. From olitour at gmail.com Mon Jul 8 07:19:43 2013 From: olitour at gmail.com (Olivier Tournaire) Date: Mon Jul 8 07:20:30 2013 Subject: [xsd-users] [cxx-tree] CityGML and ADEs Message-ID: Hi all, I was recently playing with CityGML schemas and managed to have something working with xsd cxx-tree. Now, I would like to extend files parsing with schemas from ADEs. To give it a first try, I used the NoiseADE schema distributed with "core" schemas. Following Boris tips, I managed to compile and like without import/export problems a "noiseade" library (leaf) and a "citygml" library (root). "noiseade" depends on "citygml". However, when trying to parse a sample noiseade file, I am unable to access the specific objects defined in this ADE. Here is a code sample: int main(int argc, char** argv) { try { auto_ptr iCity = auto_ptr( CityModel(DROPBOX_SAMPLES_PATH + "/NoiseADE/cityfurniture_example.xml", xsd::cxx::tree::flags::dont_validate) ); AbstractFeatureCollectionType::featureMember_sequence::const_iterator it = iCity->featureMember().begin(), ite = iCity->featureMember().end(); for(;it!=ite;++it) { // Note the use of references!!! const FeaturePropertyType& f = (*it); const AbstractFeatureType& af = f._Feature().get(); if (const frn::CityFurnitureType* r = dynamic_cast (&af)) { cout << "Got a frn::CityFurnitureType!" << endl; cout << "frn::CityFurnitureType contains " << r->_GenericApplicationPropertyOfCityFurniture().size() << " features" << endl; frn::CityFurnitureType::_GenericApplicationPropertyOfCityFurniture_sequence::const_iterator it2 = r->_GenericApplicationPropertyOfCityFurniture().begin(); frn::CityFurnitureType::_GenericApplicationPropertyOfCityFurniture_sequence::const_iterator ite2 = r->_GenericApplicationPropertyOfCityFurniture().end(); for(;it2!=ite2;++it2) { //cout << "\t* " << it->_name() << " in " << it->_namespace() << endl; if (const noise_de::NoiseCityFurnitureSegmentPropertyType* r2 = dynamic_cast (&(*it2))) cout << "\t --> Got a NoiseCityFurnitureSegmentPropertyType!" << endl; else cout << "\t --> NOT a NoiseCityFurnitureSegmentPropertyType!" << endl; } } } } catch (const xml_schema::exception& e) { cerr << "Exception caught: " << e.what() << " --> " << e << endl; } return 0; } >From this code, I am able to retrieve a "frn::CityFurnitureType" object, but cannot iterate over its children to get the noise_de::NoiseCityFurnitureSegmentPropertyType. I made another try: compile and link all citygml AND noiseade in the same DLL. In this case, I can iterate over frn::CityFurnitureType::_GenericApplicationPropertyOfCityFurniture_sequence to get all underlying objects of the frn::CityFurnitureType object. However, I would like to keep ADEs separated from the core citygml DLL. Do you have any idea on how I can achieve this? Best regards, Olivier From giuseppe500 at yahoo.it Sun Jul 7 09:12:56 2013 From: giuseppe500 at yahoo.it (giuseppe ferrari) Date: Mon Jul 8 08:00:18 2013 Subject: [xsd-users] solution to the visitor custom function? and regex or custom script? Message-ID: <1373202776.84550.YahooMailNeo@web171402.mail.ir2.yahoo.com> hello. I have a partial solution from your advice that creates a template wrapper? in which implement custom functions. this is an example of an xsd script that create the forward reference to the custom Wrapper for one type : xsd cxx-tree --custom-type contact="xml_schema::CustomWrapper/base_contact" --output-dir ifc contacts.xsd the solution is partial because i have an xsd(ifc.xsd, an architectural format) with more than 2000 classes and i must create a script or something that change this line: contact="xml_schema::CustomWrapper/base_contact" in base of the type for each xsd type, and i don't know how. I see in the documentation that i can extract the list of the types of the xsd(is true?). a python script or c script is the only solution? Or I can i do something with the regex? after that ,i can implement and insert the CustomWrapper in the xsd_schema namespace of the generated code: template < class T > ?? ?class CustomWrapper : public T ?? ?{ ?? ?public:?? ??? ? ??? CustomWrapper (const ::xercesc::DOMElement& e, ????????????????? ::xml_schema::flags f = 0, ?? ??? ??? ??? ?? ::xml_schema::container* c = 0): T (e, f, c){}; ??? CustomWrapper (const T& x, ????????????????? ::xml_schema::flags f = 0, ?? ??? ??? ??? ?? ::xml_schema::container* c = 0): T (x, f, c){}; ?? ??? ?void print(){ ?? ??? ? ?? ??? ? ?? ??? ??? ?std::string email= this->email(); ?? ??? ??? ?cout << email.c_str(); ?? ??? ?}; ?? ?}; and , the generated forward reference is like this: namespace contacts { ? class base_contact; ? typedef xml_schema::CustomWrapper contact; ? class catalog; } now i can call the custom function: int main (int argc, char* argv[]) { ? using namespace contacts; ? std::auto_ptr c (catalog_ ("contacts.xml")); ? for (catalog::contact_iterator i (c->contact ().begin ()); ?????? i != c->contact ().end ();?? i) ? { ?? ?? (*i).print(); ? } } the only problem now is the const/no const iterator and custom member function. this partial solution Is like your advice? may be correct ? and...for create the same things for all the classes of the xsd? thanks. From boris at codesynthesis.com Mon Jul 8 09:19:22 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jul 8 09:19:28 2013 Subject: [xsd-users] customizing the XSD compiler In-Reply-To: <1373017221.56325.YahooMailNeo@web171406.mail.ir2.yahoo.com> References: <1373017221.56325.YahooMailNeo@web171406.mail.ir2.yahoo.com> Message-ID: Hi Giuseppe, giuseppe ferrari writes: > Now i wish understand how i can generate the c++ classes from xsd > from the main function of my project. > What classes i need to instantiate and how to use them? > I'm Sorry but i'm not find documentation on this. There isn't any. There are a few email in the archives of this list that give an overview of the XSD architecture and where to look to customize things. I am sure you can find them with the search. Also, the source code is fairly well commented (or at least I believe so). Boris From boris at codesynthesis.com Mon Jul 8 09:22:51 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jul 8 09:22:58 2013 Subject: [xsd-users] (Generic) CityGML parsing In-Reply-To: References: Message-ID: Hi Olivier, Olivier Tournaire writes: > I am wondering if there is a way to parse ? CityGML file in a "generic" > fashion. What I mean by "generic" is without any prior knowledge on th? > file content. > > For instance, is there a way to iterate over all elements of a > CityModelType, and for each of them, to iterate over all their > sub-elements? Use DOM? If you want both "generic" and statically-typed access, (and go back and forth) then the DOM association feature might be what you are looking for. Boris From olitour at gmail.com Mon Jul 8 09:35:34 2013 From: olitour at gmail.com (Olivier Tournaire) Date: Mon Jul 8 09:36:21 2013 Subject: [xsd-users] (Generic) CityGML parsing In-Reply-To: References: Message-ID: Hi, Thanks Boris for your answer. Any pointer in the doc to get a first idea on how to achieve this? Regards, Olivier 2013/7/8 Boris Kolpackov > Hi Olivier, > > Olivier Tournaire writes: > > > I am wondering if there is a way to parse ? CityGML file in a "generic" > > fashion. What I mean by "generic" is without any prior knowledge on th? > > file content. > > > > For instance, is there a way to iterate over all elements of a > > CityModelType, and for each of them, to iterate over all their > > sub-elements? > > Use DOM? If you want both "generic" and statically-typed access, > (and go back and forth) then the DOM association feature might > be what you are looking for. > > Boris > From om_codesynthesis at keywallet.com Tue Jul 9 07:37:54 2013 From: om_codesynthesis at keywallet.com (Ovanes Markarian) Date: Tue Jul 9 07:38:22 2013 Subject: [xsd-users] CDATA entities Message-ID: Hello *, I searched the web if that is a known problem, but did not find anything about that. I currently parse an XML Document with C++/Parser which contains CDATA entities. This causes the parser to throw an exception: error: unexpected characters 'Bluetooth is a proprietary...' The element the parser is not able to parse is: There are no special characters besides '(' ')' inside. How can I fix this issue? Thanks, Ovanes From boris at codesynthesis.com Tue Jul 9 07:49:57 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jul 9 07:50:03 2013 Subject: [xsd-users] solution to the visitor custom function? and regex or custom script? In-Reply-To: <1373202776.84550.YahooMailNeo@web171402.mail.ir2.yahoo.com> References: <1373202776.84550.YahooMailNeo@web171402.mail.ir2.yahoo.com> Message-ID: Hi giuseppe, giuseppe ferrari writes: > --custom-type contact="xml_schema::CustomWrapper/base_contact" > > the solution is partial because i have an xsd(ifc.xsd, an architectural > format) with more than 2000 classes and i must create a script or something > that change this line: > > contact="xml_schema::CustomWrapper/base_contact" > > in base of the type for each xsd type, and i don't know how. The --custom-type-regex option was made exactly for that. As the saying goes, if it was a snake, it would have bitten you (or perhaps even eaten). Boris From boris at codesynthesis.com Tue Jul 9 07:57:29 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jul 9 07:57:35 2013 Subject: [xsd-users] [cxx-tree] CityGML and ADEs In-Reply-To: References: Message-ID: Hi Olivier, Olivier Tournaire writes: > I made another try: compile and link all citygml AND noiseade in the same > DLL. In this case, I can iterate over > frn::CityFurnitureType::_GenericApplicationPropertyOfCityFurniture_sequence > to get all underlying objects of the frn::CityFurnitureType object. Basically what happens is types from your noiseade DLL are not registered on the polymorphism support maps in citygml DLL for some reason. The two common reasons for this are: 1. You haven't linked noiseade DLL to your executable. 2. You haven't exported the maps from citygml and imported them in noiseade. See the --export-maps option for details. Boris From om_codesynthesis at keywallet.com Tue Jul 9 08:24:34 2013 From: om_codesynthesis at keywallet.com (Ovanes Markarian) Date: Tue Jul 9 08:25:02 2013 Subject: [xsd-users] Re: CDATA entities In-Reply-To: References: Message-ID: Ok, found out why that happened. Schema validation error, since the element is marked as having no text. Is there any way I disable schema validation after the generation? Thanks, Ovanes On Tue, Jul 9, 2013 at 1:37 PM, Ovanes Markarian < om_codesynthesis@keywallet.com> wrote: > Hello *, > > I searched the web if that is a known problem, but did not find anything > about that. I currently parse an XML Document with C++/Parser which > contains CDATA entities. This causes the parser to throw an exception: > > error: unexpected characters 'Bluetooth is a proprietary...' > > > The element the parser is not able to parse is: > > > > > There are no special characters besides '(' ')' inside. > > How can I fix this issue? > > > Thanks, > Ovanes > From boris at codesynthesis.com Wed Jul 10 07:24:54 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jul 10 07:25:01 2013 Subject: [xsd-users] (Generic) CityGML parsing In-Reply-To: References: Message-ID: Hi Olivier, Olivier Tournaire writes: > Any pointer in the doc to get a first idea on how to achieve this? Section 5.1, "DOM Association" in the C++/Tree Mapping User Manual: http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#5.1 You could have easily found it yourself with a few minutes of searching. Boris From boris at codesynthesis.com Wed Jul 10 07:27:59 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jul 10 07:28:05 2013 Subject: [xsd-users] Re: CDATA entities In-Reply-To: References: Message-ID: Hi Ovanes, Ovanes Markarian writes: > Is there any way I disable schema validation after the generation? I assume you are using Expat as the underlying XML parser (you should have provided this information in your original email so I don't have to guess). If that's the case, then, no, you can only generate code with validation enabled or disabled. With Xerces-C++ as the underlying parser you can enable/disable validation at runtime. Boris From om_codesynthesis at keywallet.com Wed Jul 10 08:03:16 2013 From: om_codesynthesis at keywallet.com (Ovanes Markarian) Date: Wed Jul 10 08:03:45 2013 Subject: [xsd-users] Re: CDATA entities In-Reply-To: References: Message-ID: On Wed, Jul 10, 2013 at 1:27 PM, Boris Kolpackov wrote: > tion enabled or disabled. With Xerces-C++ as the underlying > parser you can enable/disable validation at runtime. > Ok, sorry for forgetting that... I will regenerate the stuff... Many thanks for you support and great lib! Ovanes From G.Klima at durst-online.at Wed Jul 10 08:17:15 2013 From: G.Klima at durst-online.at (Klima Georg) Date: Wed Jul 10 08:17:27 2013 Subject: [xsd-users] xerces validation problem Message-ID: <2E884AD3C8BC814186EA906C9C487F223658B6D1@ditmail1> Hi all, I do have a strange problem when compiling with XSD and it seems that its cause is located in xerces-c. The error message: ERROR: element 'Print' has type that does not derive from type of corresponding element in the base ----------------------------------------------------------------------------------------- - The part where the error manifests itself - ----------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------- - The corresponding type defs - ----------------------------------------------------------------------------------------- As one could see, SlotPrintPrimitive_at is a direct descendant of PrintPrimitive_at. libxml (xmllint) and qt (xmlpatternsvalidator) perfectly accept this construct. - Who is wrong? Tested xerces-c with PParse -f -s -n XML-File and the error as stated above is printed to console. What can I do? - Any help is appreciated! XSD: 3.3.0 XERCES-C: 3.1.1 Mit freundlichen Gr??en / Best regards ------------------------------------------- Georg Klima Software Development Durst Phototechnik Digital Technology GmbH Julius-Durst-Stra?e 11 9900 Lienz Tel.: +43 (0) 4852 71777 612 Fax: +43 (0) 4852 71777 50 eMail: G.Klima@durst-online.at Visit us on http://www.durst-online.com Firmenbuchnummer FN 169731f Firmenbuchgericht: Landesgericht Innsbruck UID: ATU44640705 Please consider the environment before printing this email. ------------------------------------------- From olitour at gmail.com Wed Jul 10 17:02:03 2013 From: olitour at gmail.com (Olivier Tournaire) Date: Wed Jul 10 17:02:51 2013 Subject: [xsd-users] (Generic) CityGML parsing In-Reply-To: References: Message-ID: Boris, Thanks. I will have a look at it. Regards 2013/7/10 Boris Kolpackov > Hi Olivier, > > Olivier Tournaire writes: > > > Any pointer in the doc to get a first idea on how to achieve this? > > Section 5.1, "DOM Association" in the C++/Tree Mapping User Manual: > > > http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#5.1 > > You could have easily found it yourself with a few minutes of searching. > > Boris > From olitour at gmail.com Wed Jul 10 17:06:29 2013 From: olitour at gmail.com (Olivier Tournaire) Date: Wed Jul 10 17:07:16 2013 Subject: [xsd-users] [cxx-tree] CityGML and ADEs In-Reply-To: References: Message-ID: Thanks Boris. I managed to have all working. In fact, the problem was caused by VC++ 2010) which did not linked the executable to noiseade (whereas it was in libs to link against). I had to explicitely use (a dynamic cast as in my example was not enough) a type contained in the DLL to have my executable load the the DLL, and, thus, all worked like a charm. Maybe some "VC++ optimization" I was not aware of... Anyway, thanks for your support. 2013/7/9 Boris Kolpackov > Hi Olivier, > > Olivier Tournaire writes: > > > I made another try: compile and link all citygml AND noiseade in the same > > DLL. In this case, I can iterate over > > > frn::CityFurnitureType::_GenericApplicationPropertyOfCityFurniture_sequence > > to get all underlying objects of the frn::CityFurnitureType object. > > Basically what happens is types from your noiseade DLL are not registered > on the polymorphism support maps in citygml DLL for some reason. The two > common reasons for this are: > > 1. You haven't linked noiseade DLL to your executable. > > 2. You haven't exported the maps from citygml and imported them in > noiseade. See the --export-maps option for details. > > Boris > From boris at codesynthesis.com Thu Jul 11 08:05:17 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jul 11 08:05:24 2013 Subject: [xsd-users] xerces validation problem In-Reply-To: <2E884AD3C8BC814186EA906C9C487F223658B6D1@ditmail1> References: <2E884AD3C8BC814186EA906C9C487F223658B6D1@ditmail1> Message-ID: Hi Georg, Klima Georg writes: > ERROR: element 'Print' has type that does not derive from type of > corresponding element in the base > > > > > > > > > > > > > > Your SlotUnrestricted_vt derives by restriction from PrinterComponent_at. This means that any instance of SlotUnrestricted_vt should also be valid per PrinterComponent_at. However, your SlotPrintPrimitive_at is an extension of PrintPrimitive_at (it adds extra attributes). As a result, it cannot be used in this restriction (it allows more than the base). > libxml (xmllint) and qt (xmlpatternsvalidator) perfectly accept this > construct. - Who is wrong? While the error message is slightly misleading, Xerces-C++ is correct and the other two validators are broken. Boris From G.Klima at durst-online.at Thu Jul 11 09:19:00 2013 From: G.Klima at durst-online.at (Klima Georg) Date: Thu Jul 11 09:19:12 2013 Subject: AW: [xsd-users] xerces validation problem In-Reply-To: References: <2E884AD3C8BC814186EA906C9C487F223658B6D1@ditmail1> Message-ID: <2E884AD3C8BC814186EA906C9C487F223658B75A@ditmail1> Hi Boris, thank you, you saved my day! It seems now clear to me! Simply in the chain of extension/restriction (viewed from base to derived) there must not be any extension after restriction! ----------------------------------------- CASE A (valid): Base | (extension) | Derived1 | (restriction) | Derived2 ---------------------------------------- CASE B (invalid): Base | (restriction) | Derived1 | (extension) | Derived2 ----------------------------------------- While case A is valid case B isn't. After a restriction a type can't be extended anymore, since the last type before the first restriction defines the maximal "content/specification". LG Georg -----Urspr?ngliche Nachricht----- Von: Boris Kolpackov [mailto:boris@codesynthesis.com] Gesendet: Donnerstag, 11. Juli 2013 14:05 An: Klima Georg Cc: xsd-users@codesynthesis.com Betreff: Re: [xsd-users] xerces validation problem Hi Georg, Klima Georg writes: > ERROR: element 'Print' has type that does not derive from type of > corresponding element in the base > > > > > > > > > > > > > > Your SlotUnrestricted_vt derives by restriction from PrinterComponent_at. This means that any instance of SlotUnrestricted_vt should also be valid per PrinterComponent_at. However, your SlotPrintPrimitive_at is an extension of PrintPrimitive_at (it adds extra attributes). As a result, it cannot be used in this restriction (it allows more than the base). > libxml (xmllint) and qt (xmlpatternsvalidator) perfectly accept this > construct. - Who is wrong? While the error message is slightly misleading, Xerces-C++ is correct and the other two validators are broken. Boris From giuseppe500 at yahoo.it Sun Jul 14 23:48:58 2013 From: giuseppe500 at yahoo.it (giuseppe ferrari) Date: Mon Jul 15 06:35:47 2013 Subject: [xsd-users] Re: solution to the visitor custom function? and regex or custom script? In-Reply-To: <1373202776.84550.YahooMailNeo@web171402.mail.ir2.yahoo.com> References: <1373202776.84550.YahooMailNeo@web171402.mail.ir2.yahoo.com> Message-ID: <1373860138.17400.YahooMailNeo@web171404.mail.ir2.yahoo.com> hello. I have a new problem with the generated tree with xsd.exe and the Wrapper template (for insert custom functions on the wrapper template). The problem is, as you already saw the constructors. I get this error for example: Error??? 42??? error C2661: 'xml_schema::Wrapper::Wrapper' : no overloaded function takes 3 arguments??? c:\ifc\dllifc\ifc\ifc2x3.cxx??? 141383??? dllIfc??? 1 [code] ?base_IfcGeometricRepresentationItem:: ????? base_IfcGeometricRepresentationItem (const ::ifcXML::IFC2x3::FINAL::IfcRepresentationItem& _xsd_IfcRepresentationItem_base) ????? : ::ifcXML::IFC2x3::FINAL::IfcRepresentationItem (_xsd_IfcRepresentationItem_base) ????? { ????? } ????? base_IfcGeometricRepresentationItem:: ????? base_IfcGeometricRepresentationItem () ????? : ::ifcXML::IFC2x3::FINAL::IfcRepresentationItem () ????? { ????? } ????? base_IfcGeometricRepresentationItem:: ????? base_IfcGeometricRepresentationItem (const base_IfcGeometricRepresentationItem& x, ?????????????????????????????????????????? ::xml_schema::flags f, ?????????????????????????????????????????? ::xml_schema::container* c) ????? : ::ifcXML::IFC2x3::FINAL::IfcRepresentationItem (x, f, c) //ERROR ????? { ????? } ????? base_IfcGeometricRepresentationItem:: ????? base_IfcGeometricRepresentationItem (const ::xercesc::DOMElement& e, ?????????????????????????????????????????? ::xml_schema::flags f, ?????????????????????????????????????????? ::xml_schema::container* c) ????? : ::ifcXML::IFC2x3::FINAL::IfcRepresentationItem (e, f, c) ????? { ????? } ????? base_IfcGeometricRepresentationItem* base_IfcGeometricRepresentationItem:: ????? _clone (::xml_schema::flags f, ????????????? ::xml_schema::container* c) const ????? { ??????? return new class base_IfcGeometricRepresentationItem (*this, f, c); ????? } ????? base_IfcGeometricRepresentationItem:: ????? ~base_IfcGeometricRepresentationItem () ????? { ????? } [/code] ????? base_IfcGeometricRepresentationItem:: ????? base_IfcGeometricRepresentationItem (const base_IfcGeometricRepresentationItem& x, ?????????????????????????????????????????? ::xml_schema::flags f, ?????????????????????????????????????????? ::xml_schema::container* c) ????? : ::ifcXML::IFC2x3::FINAL::IfcRepresentationItem (x, f, c) //ERROR ????? { ????? } i saw that there are custom option for the constructors in xsd.exe and i use --generate-default-ctor in the hope of construct all with the default constructor, but it's not sufficent, have you another advice for me? Is a solution ,remove all the constructors and leave only the default constructor? sorry if I ask again , but i ask only for an advice then i go ahead alone. thanks. ________________________________ Da: giuseppe ferrari A: "xsd-users@codesynthesis.com" Inviato: Domenica 7 Luglio 2013 15:12 Oggetto: solution to the visitor custom function? and regex or custom script? hello. I have a partial solution from your advice that creates a template wrapper? in which implement custom functions. this is an example of an xsd script that create the forward reference to the custom Wrapper for one type : xsd cxx-tree --custom-type contact="xml_schema::CustomWrapper/base_contact" --output-dir ifc contacts.xsd the solution is partial because i have an xsd(ifc.xsd, an architectural format) with more than 2000 classes and i must create a script or something that change this line: contact="xml_schema::CustomWrapper/base_contact" in base of the type for each xsd type, and i don't know how. I see in the documentation that i can extract the list of the types of the xsd(is true?). a python script or c script is the only solution? Or I can i do something with the regex? after that ,i can implement and insert the CustomWrapper in the xsd_schema namespace of the generated code: template < class T > ?? ?class CustomWrapper : public T ?? ?{ ?? ?public:?? ??? ? ??? CustomWrapper (const ::xercesc::DOMElement& e, ????????????????? ::xml_schema::flags f = 0, ?? ??? ??? ??? ?? ::xml_schema::container* c = 0): T (e, f, c){}; ??? CustomWrapper (const T& x, ????????????????? ::xml_schema::flags f = 0, ?? ??? ??? ??? ?? ::xml_schema::container* c = 0): T (x, f, c){}; ?? ??? ?void print(){ ?? ??? ? ?? ??? ? ?? ??? ??? ?std::string email= this->email(); ?? ??? ??? ?cout << email.c_str(); ?? ??? ?}; ?? ?}; and , the generated forward reference is like this: namespace contacts { ? class base_contact; ? typedef xml_schema::CustomWrapper contact; ? class catalog; } now i can call the custom function: int main (int argc, char* argv[]) { ? using namespace contacts; ? std::auto_ptr c (catalog_ ("contacts.xml")); ? for (catalog::contact_iterator i (c->contact ().begin ()); ?????? i != c->contact ().end ();?? i) ? { ?? ?? (*i).print(); ? } } the only problem now is the const/no const iterator and custom member function. this partial solution Is like your advice? may be correct ? and...for create the same things for all the classes of the xsd? thanks. From boris at codesynthesis.com Mon Jul 15 06:59:57 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jul 15 07:00:03 2013 Subject: [xsd-users] Re: solution to the visitor custom function? and regex or custom script? In-Reply-To: <1373860138.17400.YahooMailNeo@web171404.mail.ir2.yahoo.com> References: <1373202776.84550.YahooMailNeo@web171402.mail.ir2.yahoo.com> <1373860138.17400.YahooMailNeo@web171404.mail.ir2.yahoo.com> Message-ID: Hi Giuseppe, giuseppe ferrari writes: > The problem is, as you already saw the constructors. > I get this error for example: > > base_IfcGeometricRepresentationItem:: > base_IfcGeometricRepresentationItem (const base_IfcGeometricRepresentationItem& x, > ::xml_schema::flags f, > ::xml_schema::container* c) > : ::ifcXML::IFC2x3::FINAL::IfcRepresentationItem (x, f, c) //ERROR This is a copy constructor (with extra flag and container arguments). You should be able to provide one in your wrapper: template class Wrapper: public B { public: ... Wrapper (const Wrapper& w, xml_schema::flags f, xml_schema::container* c) : B (w, f, c) { } ... }; What may also happen is that the generated code may require "initialization" constructors that are not regular (i.e., they have a varying number of arguments with varying types). Unfortunately, there is no way to suppress their generation in XSD. But what you can do instead is provide forwarding contructors in this form: template Wrapper (const T1& x1) : B (x1) { } template Wrapper (const T1& x1, const T2& x2) : B (x1, x2) { } template Wrapper (const T1& x1, const T2& x2, const T3& x3) : B (x1, x2, x3) { } ... If you are using C++11, then you may want to use perfect forwarding (and variadic templates) instead. But I believe the above C++98 version will also work. Boris From giuseppe500 at yahoo.it Mon Jul 22 12:48:06 2013 From: giuseppe500 at yahoo.it (giuseppe ferrari) Date: Tue Jul 23 04:38:18 2013 Subject: [xsd-users] compiler error Message-ID: <51ED6246.8040100@yahoo.it> hello Boris. i Have finished with the custom wrapper, but after two days of testI always gets the same error: [code] 1>------ Build started: Project: dllIfc, Configuration: Debug Win32 ------ 1>Build started 22/07/2013 06:14:04. 1>InitializeBuildStatus: 1> Touching "Debug\dllIfc.unsuccessfulbuild". 1>ClCompile: 1> ifc2x3.cxx 1>c:\ifc\codesynthesis xsd 3.3\include\xsd\cxx\tree\type-serializer-map.txx(530): fatal error C1001: An internal error has occurred in the compiler. 1> (compiler file 'msc1.cpp', line 1443) 1> To work around this problem, try simplifying or changing the program near the locations listed above. 1> Please choose the Technical Support command on the Visual C++ 1> Help menu, or open the Technical Support help file for more information 1> c:\ifc\codesynthesis xsd 3.3\include\xsd\cxx\tree\type-serializer-map.txx(542) : see reference to function template instantiation 'void xsd::cxx::tree::serializer_impl(xercesc_3_1::DOMElement &,const xsd::cxx::tree::type &)' being compiled 1> with 1> [ 1> T=ifcXML::IFC2x3::FINAL::base_IfcMotorConnectionType 1> ] 1> c:\ifc\codesynthesis xsd 3.3\include\xsd\cxx\tree\type-serializer-map.txx(538) : while compiling class template member function 'xsd::cxx::tree::type_serializer_initializer::type_serializer_initializer(const C *,const C *)' 1> with 1> [ 1> id=0, 1> C=char, 1> T=ifcXML::IFC2x3::FINAL::base_IfcMotorConnectionType 1> ] 1> c:\ifc\dllifc\ifc\ifc2x3.cxx(414448) : see reference to function template instantiation 'xsd::cxx::tree::type_serializer_initializer::type_serializer_initializer(const C *,const C *)' being compiled 1> with 1> [ 1> id=0, 1> C=char, 1> T=ifcXML::IFC2x3::FINAL::base_IfcMotorConnectionType 1> ] 1> c:\ifc\dllifc\ifc\ifc2x3.cxx(414448) : see reference to class template instantiation 'xsd::cxx::tree::type_serializer_initializer' being compiled 1> with 1> [ 1> id=0, 1> C=char, 1> T=ifcXML::IFC2x3::FINAL::base_IfcMotorConnectionType 1> ] 1> 1>Build FAILED. 1> 1>Time Elapsed 00:06:57.48 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== [/code] what can be? I use visual studio 12 and this platform :Visual Studio 2012 (v110) I have a huge source file of 20 MB (.cxx)may be that is too big? I have 4 gb of ram and a 64 bit OS(windows 7 64 bit) If i see the memory in the task manager there is a rapid increase of the memory usage (4gb) after 6 minutes from the compilation start , and i get the error thanks. From bradleyd.snyder at gmail.com Mon Jul 22 21:07:22 2013 From: bradleyd.snyder at gmail.com (Bradley Snyder) Date: Tue Jul 23 04:38:19 2013 Subject: [xsd-users] Building on OSX x86_64 Message-ID: Hi, I'm currently trying to use this project to get my Java JAXB functionality on a similar C++-oriented project being developed on OSX. Unfortunately you only have binaries available for PowerPC and x86 and I need x86_64. I attempted to build this myself but cannot get the libcult makefiles to work. Could you provide an x86_64 OSX binary distribution? Thanks! -Brad Snyder From bradleyd.snyder at gmail.com Mon Jul 22 21:13:07 2013 From: bradleyd.snyder at gmail.com (Bradley Snyder) Date: Tue Jul 23 04:38:19 2013 Subject: [xsd-users] Disregard previous e-mail Message-ID: Hello again, I didn't pay enough attention and was thinking I was looking for a set of compiled libraries and such that I was going to be linking to. I now see that I am just downloading a binary to generate the appropriate classes; there is no need for a 64-bit compiled version of CS-XSD. Please disregard my e-mail, hope I didn't waste anyone's time. -Brad Snyder From boris at codesynthesis.com Tue Jul 23 05:38:40 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jul 23 05:39:11 2013 Subject: [xsd-users] compiler error In-Reply-To: <51ED6246.8040100@yahoo.it> References: <51ED6246.8040100@yahoo.it> Message-ID: Hi Giuseppe, giuseppe ferrari writes: > I have a huge source file of 20 MB (.cxx)may be that is too big? Yes, that is the likely issue. Take a look at the --parts option which allows you to split the source file into smaller parts. Boris From TAMIRB at MarvinTest.com Mon Jul 29 19:50:37 2013 From: TAMIRB at MarvinTest.com (Tamir Bard) Date: Tue Jul 30 06:37:23 2013 Subject: [xsd-users] multiple compressed data streams Message-ID: <96138E3B4A3BC04180A8CD85983884BA23185B66FF@GeoMailServer> Hi, I would like to store and read multiple compressed data streams. Each compressed data stream needs to be accessed (read and write) in small chunks. How can I do that? Thanks, T. Bard From boris at codesynthesis.com Tue Jul 30 06:56:59 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jul 30 06:57:29 2013 Subject: [xsd-users] multiple compressed data streams In-Reply-To: <96138E3B4A3BC04180A8CD85983884BA23185B66FF@GeoMailServer> References: <96138E3B4A3BC04180A8CD85983884BA23185B66FF@GeoMailServer> Message-ID: Hi Tamir, Tamir Bard writes: > I would like to store and read multiple compressed data streams. > Each compressed data stream needs to be accessed (read and write) > in small chunks. This is a very generic description of what you trying to do. Do you want to "store" as a file on disk, in a database, something else? What is a "data stream"? A file stream maybe? What is a "chunk"? Is it an XML document, a fragment of a document, something else? Without knowing more specifics, it is hard to suggest how it can be achieved. You may find interesting the 'compression' and 'streaming' examples in the examples/cxx/tree/ directory. Boris From TAMIRB at MarvinTest.com Wed Jul 31 18:38:52 2013 From: TAMIRB at MarvinTest.com (Tamir Bard) Date: Thu Aug 1 08:06:04 2013 Subject: [xsd-users] multiple compressed data streams In-Reply-To: References: <96138E3B4A3BC04180A8CD85983884BA23185B66FF@GeoMailServer> Message-ID: <96138E3B4A3BC04180A8CD85983884BA23185B67AC@GeoMailServer> Hi Boris, There are 8 streams of data that needs to be stored. 1. Each stream of data if of type LONG 2. Each stream of data is stored in (consecutive) blocks of 256K each. 3. Each stream of data may have 1 block (minimum) or up to 64 blocks of data (each block might have a slightly different size). 4. Since the total amount of data can be big, we need to parse/read those blocks of data locations only when the code asks for ant not Once the file is written, at later time those 8 streams of data blocks needs to editable (reducing number of blocks or adding). Note: each data block will be compressed before written. Can all of this be done using codesynthesis xsd? Do you have an example code that does that? Thanks, T. Bard -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Tuesday, July 30, 2013 3:57 AM To: Tamir Bard Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] multiple compressed data streams Hi Tamir, Tamir Bard writes: > I would like to store and read multiple compressed data streams. > Each compressed data stream needs to be accessed (read and write) in > small chunks. This is a very generic description of what you trying to do. Do you want to "store" as a file on disk, in a database, something else? What is a "data stream"? A file stream maybe? What is a "chunk"? Is it an XML document, a fragment of a document, something else? Without knowing more specifics, it is hard to suggest how it can be achieved. You may find interesting the 'compression' and 'streaming' examples in the examples/cxx/tree/ directory. Boris