8

Is there any good automatic xml to C++ object library ?

With good benchmark and Multi - Platform support (if not at-least linux )

Edit : More Description

I want to library like http://www.codesynthesis.com/products/xsd/ where I can use any xml as c++ object.

XMLOBJECT x=new XMLOBJECT("my.xml");

x->root
x->root->child

Means XML Data Binding in C++

2
  • 1
    Note that to do that you need to preprocess the XSD for your XML types to C++ classes. You cannot throw arbitrary XML at this and expect to code for it. This is because C++ does not support dynamic class generation. It's a statically compiled language. Commented May 31, 2011 at 14:52
  • @Macke yes I will be having XSD for each xml. Commented May 31, 2011 at 16:03

6 Answers 6

7

I think that you refer to what is called XML Data Binding.

gsoap is a free tool that does it. There are of course many commercial tools - XML Spy and others. Here is a nice list of resources.

Sign up to request clarification or add additional context in comments.

Comments

2

boost::serialization provides that functionality, you can serialize your object to xml and back as well as to the other formats.

Comments

1

If I understand correctly, you are looking for something like pococapsule

Comments

1

We use Codalogic LMX; a bit expensive, but they have a free "express" edition that might be good enough.

Comments

0

You may try this lib. It's multi-platform

Comments

0

There are many. Please see some of them

2 Comments

do all of them do data binding, or some are just for xml parsing?
Some are just for parsing. TinyXML for example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.