从 xsd 生成 C++ 类的 JAXB 等价物? [英] JAXB equivalent for generating c++ classes from xsd?

查看:31
本文介绍了从 xsd 生成 C++ 类的 JAXB 等价物?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JAXB 提供了一种非常 OOP 的方式来处理 xml 数据,是否有任何此类替代方法或脚本可用于 C++.寻找一些独立于操作系统的工具,即:应该在 linux、windows 等中工作.

工具应该像从 XSD Schema 生成 JAXB 那样生成 C++ 类.

在我以前的组织中,我们使用了一个 perl 脚本来执行相同的工作,但这非常原始(没有处理继承等).perl 或 python 脚本将是超级的.

解决方案

让我印象深刻CodeSynthesis XSD,虽然我只是对它进行了修改.缺点之一(无论如何对于我们的项目而言)是它们提供自定义类来处理 XML Schema 项目,但我不相信您可以更改映射以提供您自己的(至少在我查看它时).

JAXB provides a very OOP way for handling xml data, is there any such alternative or script avaiable for c++. Looking for some tool which is OS independent ie: should work in linux, windows, etc.

Tool should be generating c++ classes like the way JAXB generated from XSD Schema.

We used have a perl script performing the same job in my previous organization but that was quite primitive (didn't handle inheritance etc). perl or python scripts will be super.

解决方案

I've been pretty impressed with CodeSynthesis XSD, although I only tinkered with it. One of the downsides (for our project, anyway) was that they provide custom classes to handle XML Schema items, but I don't believe you can change the mapping to provide your own (at least when I looked at it).

这篇关于从 xsd 生成 C++ 类的 JAXB 等价物?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆