我正在寻求一种有效的方法来处理嵌入式设备上的xml数据,这些数据的性能因素非常有限(RAM和CPU)。 XML的优点是可以通过基于计算机的软件工具轻松处理。一旦数据被建模并加载到嵌入式设备,它将保持静态。嵌入式设备的二进制XML表示和处理
我认为二进制XML表示法是最好的选择。但是我应该遵循哪种转换标准,还是我应该创造一些全新的东西?
要求:
- 清除编码规则,从而确定性二进制格式作为结果
- 有效随机存取为二进制数据(下一个元素)通过
- 容易获得C-数据结构
示例数据:
<Employee>
<Name>
<GivenName>Gaston</GivenName>
<FamilyName>Lagaffe<FamilyName>
</Name>
<innovation>
<description>Cosmo-coucou : horloge murale imitant la cabine Apollo </description>
<drawing>604</drawing>
</innovation>
<innovation>
<description>Parapluie simulateur de beau temps </description>
<drawing>648</drawing>
</innovation>
最后轻松地与ç对待这个二进制数据,如提取数据到结构等的能力,以符合最重要的要求。
struct Employee {
name *name;
innovation *inovations;
};
struct name {
char *GivenName;
char *FamilyName;
};
struct innovation {
char *Description;
int drawing;
};
可以asn1c帮我这个吗?
使用ASN.1编码规则可以完成这项工作吗?
您对嵌入式设备上的二进制XML数据有什么经验?
请参见:[在语言中序列化数据...](http://stackoverflow.com/questions/144435/whats-the-best-way-to-serialize-data-in-a-language-independent-二进制格式)的一些相关信息。还有[CodeSynthesis XSD/e](http://www.codesynthesis.com/products/xsde/)和[Wikipedia data binding](http://en.wikipedia.org/wiki/XML_data_binding)页面。 – 2013-05-13 20:33:07