tags:

views:

242

answers:

4

Hi,

I'd like to know if there's a tool which allows you to do class definition based on an XML format. I'm not looking for data binding. Anyone can help ?

Thanks

+2  A: 

When I had this problem a few years back, I wrote a Python tool to execute Python code embedded in text files so that I could generate C++ code with Python inside the C++: http://nedbatchelder.com/code/cog/

Ned Batchelder
I'll check that thanks.
lollancf37
A: 

YACC or BISON may be what you are after.

teambob
It's true that it would invlove some parsing but I XML parsing don't require the direct use of YACC or BISON
lollancf37
A: 

Are UML Class Diagrams what you are looking for?

brianary
No but I know tools which can generate code from UML, that could solve my problem if I found myself being more productive typing that drawings schema.
lollancf37
A: 

I know of two tools both of them are commercial products

http://www.codesynthesis.com/products/xsd/

http://www.codalogic.com/lmx/

  • don't know any more than the web site

I hope this helps.

Update:

Just found this http://en.wikipedia.org/wiki/XML_data_binding#C.2B.2B

Update 2:

This is great, I have been looking for an open source package to do this for ages and your question has just helped my find it:

http://top.touk.pl/confluence/display/xmlbeansxxdoc/Introduction+to+xmlbeansxx http://top.touk.pl/confluence/download/attachments/458767/Manipulate_XML_Documents_in_CPP_with_xmlbeansxx.pdf

iain
Hi,I've already known about codesynthesis, while it does produce C++ code from XML files, it's more a binding of data, than the generation of C++ classes itself. I've also known of codealogic, I'm not sure of what it does exactly i was planing on tryin it later this week, you just confirmed tha tI should ^^I'm happy that we could help each other.I don't think i explain myself clearly, I am more searching for a tool which would automate the protyping of classes from an XML file that interactimg and manipulating XML with C++.But the pdf look interesting, thank you :)
lollancf37
OK I was looking for a code generator for turning an xml schema to a set of value object classes for reading and writing the xml schema because I hate writing dom manipulation code.
iain