嵌入式系统上的C XML库 [英] C XML library for Embedded Systems

查看:184
本文介绍了嵌入式系统上的C XML库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为该公司使用XML将数据传输到了系统的嵌入式系统的项目。我不想让XML处理下放成一堆生成使用的snprintf() / 的strcat()XML字符串位和朋友或通过计算分析XML< > 。字符

I'm working on a project for an embedded system that's using XML for getting data into and out of the system. I don't want the XML handling to devolve into a bunch of bits that build XML strings using snprintf()/strcat() and friends or parse XML by counting "<" and ">" characters.

我已经发现了几个XML库,一对夫妇,其中甚至可能是足够小,但他们来为C最接近的是C ++,这是不是在卡这个系统。我希望我能找到符合以下限制的XML库:

I've found several XML libraries, a couple of which might even be small enough, but the closest they come to C is C++, which is not in the cards for this system. I hoping I can find an XML library that meets the following constraints:


  • C源$ C ​​$ C

  • 没有动态内存分配

  • 便宜。免费是好,但copyleft的不会做的伎俩。

这不一定是一个完整的解析器 - 我只是希望能够将文本拉出嵌套元素,并有一个相当简单的方法来生成XML不依赖于格式字符串。属性不被使用(还),从而库不需要甚至支持它们。 XML文档将是pretty小,所以东西的DOM样就可以了,只要它会使用客户端提供的缓冲区的工作(解析就地原始XML将是不错)。

It doesn't have to be a full parser - I just want to be able to pull text out of nested elements and have a reasonably simple way to generate XML that doesn't rely on format strings. Attributes aren't being used (yet), so the library doesn't need to support them even. The XML documents will be pretty small, so something that's DOM-like would be fine, as long as it'll work with client-provided buffers (parsing the raw XML in-place would be nice).

PugXML和TinyXML的看起来是pretty接近,但我希望有人在那里知道的只是专为我的谷歌搜索缺少基于C语言嵌入式系统的XML库。

PugXML and TinyXML look to be pretty close, but I'm hoping that someone out there knows about an XML lib tailored just for C-based embedded systems that my googling is missing.

推荐答案

我不知道动态内存分配,而是一个标准的C的XML解析器是的外籍,该为数字解析器在那里的基础库

I don't know about dynamic memory allocation, but a standard C XML parser is expat, which is the underlying library for a number of parsers out there.

这篇关于嵌入式系统上的C XML库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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