My real favorite, using the Java-plattform, is JAXB. A hell of a xml binding framework. Flexible, fast, easy to use and with a lot of power.
For sure, I love Java!
(Ok, 8 years ago i'll kick every man who is saying such a terrible thing about me! But in fact: Java is cool!)
But also, i'm in love with c++. My first love. So, i wish there was such a cool thing like JAXB in c++.
There are a lot of xml-frameworks for c++. But nothing compares to JAXB. Ok, libxml with SAX or DOM are cool, too. But fiddling around SAX-Callbacks or drowing down using the DOM-API...aaaarg!
I'll read some XML-Documents! Setup-Files, Object-Descriptors, maybe an JNLP-File...some sort of this things! And i'll get a c++-Object, describing the hole document. And i'm not interessted in such fooling things like comment-nodes.
In JAXB, usually we are doing this like that:
Object o = JaxbContext.newContext(...).unmarshall(someSource);
And have to struggle with a lot instanceof statements. Not nice, but the object is unmarshalled!
Ok, lets build our own "JAXB for C++"...let's call it cppxb.
Last edit: Andreas Knoll 2016-05-10
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For now, i'll be focused on Unmarshalling. See the school.xml-Example inside the test-Folder.
Unmarshalling is the big challange. In JAXB, we have a lot of annotations with runtime rentention, supporting the big beast. Using c++, we dont have such a foolish thing. After compile, we have machine dependend code. There is no place for annotations...
Don't worry, there are other ways.
Look at the "school-example" inside the test-folder. You'll see complete Unmarshalling. Including native data types (like some integer types), complex data types, collections of complex data types, aggregations of complex data types and base64 encoded byte arrays.
Marshalling
Ok, Marshalling will be important too. Thats the part, i'll work on after the complete unmarshalling game...
Schema-Compiler
One of the coolest features using JAXB! But, today i'm not planning such a thing. Maybe in the future....and maybe i'll using java to do so. Maybe
Last edit: Andreas Knoll 2016-05-07
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My development environment is usual an ubuntu 15.10/16.04 operating system. On top of this OS, i'm using eclipse CDT as C++-IDE. It's easy to use.
To compile and use cppxb, at least you have to install the libxml2-dev package: sudo apt-get install libxml2-dev
I'm using a lot of cpp-11 constructs. So, you need an cpp-11-compliant compiler. On my box residents an g++ 5.2.1.
Because i'm using eclipse-cdt, there are no Makefile-artefacts. Eclipse-CDT will generate them on demand. If you are planning to use cppxb without using eclipse-cdt, you have to create your own Makefiles. But this will be easy...
Thats it.
Last edit: Andreas Knoll 2016-05-07
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
cppxb is free software, it's under the GPL V3. So, everyone is free to use this software. Everyone is free to modify them. And everyone is free to include this software into own projects. Of course, under the definitions of GPLv3...
If you are using this project, it will be nice to put a reference to this project page into your documentation. Thx.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What is cppxb?
My real favorite, using the Java-plattform, is JAXB. A hell of a xml binding framework. Flexible, fast, easy to use and with a lot of power.
For sure, I love Java!
(Ok, 8 years ago i'll kick every man who is saying such a terrible thing about me! But in fact: Java is cool!)
But also, i'm in love with c++. My first love. So, i wish there was such a cool thing like JAXB in c++.
There are a lot of xml-frameworks for c++. But nothing compares to JAXB. Ok, libxml with SAX or DOM are cool, too. But fiddling around SAX-Callbacks or drowing down using the DOM-API...aaaarg!
I'll read some XML-Documents! Setup-Files, Object-Descriptors, maybe an JNLP-File...some sort of this things! And i'll get a c++-Object, describing the hole document. And i'm not interessted in such fooling things like comment-nodes.
In JAXB, usually we are doing this like that:
Object o = JaxbContext.newContext(...).unmarshall(someSource);
And have to struggle with a lot instanceof statements. Not nice, but the object is unmarshalled!
Ok, lets build our own "JAXB for C++"...let's call it cppxb.
Last edit: Andreas Knoll 2016-05-10
What are the intensions of cppxb?
Unmarshalling
For now, i'll be focused on Unmarshalling. See the school.xml-Example inside the test-Folder.
Unmarshalling is the big challange. In JAXB, we have a lot of annotations with runtime rentention, supporting the big beast. Using c++, we dont have such a foolish thing. After compile, we have machine dependend code. There is no place for annotations...
Don't worry, there are other ways.
Look at the "school-example" inside the test-folder. You'll see complete Unmarshalling. Including native data types (like some integer types), complex data types, collections of complex data types, aggregations of complex data types and base64 encoded byte arrays.
Marshalling
Ok, Marshalling will be important too. Thats the part, i'll work on after the complete unmarshalling game...
Schema-Compiler
One of the coolest features using JAXB! But, today i'm not planning such a thing. Maybe in the future....and maybe i'll using java to do so. Maybe
Last edit: Andreas Knoll 2016-05-07
What do you need to use cppxb?
My development environment is usual an ubuntu 15.10/16.04 operating system. On top of this OS, i'm using eclipse CDT as C++-IDE. It's easy to use.
To compile and use cppxb, at least you have to install the libxml2-dev package:
sudo apt-get install libxml2-dev
I'm using a lot of cpp-11 constructs. So, you need an cpp-11-compliant compiler. On my box residents an g++ 5.2.1.
Because i'm using eclipse-cdt, there are no Makefile-artefacts. Eclipse-CDT will generate them on demand. If you are planning to use cppxb without using eclipse-cdt, you have to create your own Makefiles. But this will be easy...
Thats it.
Last edit: Andreas Knoll 2016-05-07
cppxb licence
cppxb is free software, it's under the GPL V3. So, everyone is free to use this software. Everyone is free to modify them. And everyone is free to include this software into own projects. Of course, under the definitions of GPLv3...
If you are using this project, it will be nice to put a reference to this project page into your documentation. Thx.