XML data binding for C++ like JAXB for java

走远了吗. 提交于 2019-12-02 06:28:38

问题


I am writing this question as a complete **naive** in this field of "Use of data binding and parsing in c++". So, please bear with me . :)

You may find this question as duplicate of THIS

After doing a bit of googling I found that what C++ has similar library to JAXB for java for object representation of an XML in the form of "Code Synthesis xsd" and "Boost Serialization"

1) Now what I want to ask is that can "Boost Serialization" perform all the functions that CodeSynthesis is able to do ?

2) If yes, which one of it would be better to use if we take into account

 1) Dependency   2) Performance   3) Ease of use 

3) What would be its performance if we compare with Java JAXB ? [Optional question...only if someone have a link to the benchmarks]

Thanks.


回答1:


Answer to the first question: No! Serialization is almost always a small subset of data-binding. Data binding gives you an object model specific to your schema. That means you have to have a schema to use data-binding. No such need for XML serialization/deserilization. Check this too: http://www.rpbourret.com/xml/XMLDataBinding.htm

2) It is like comparing apples and oranges. As far as ease-of-use is concerned, I would say data binding is better.

3) This thread looks relevant: http://lists.xml.org/archives/xml-dev/200812/msg00141.html



来源:https://stackoverflow.com/questions/7015006/xml-data-binding-for-c-like-jaxb-for-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!