您的位置:首页 > 编程语言 > C语言/C++

几个C/C++的 XML解析库(包括纯C的读写查找XML文件的库,都是开源的)

2011-10-30 22:43 531 查看
先介绍一个实用的:Mini-XML 2.6

详细说明:minixml2.6最新的版本。 嵌入式xml 解析、查找、生成、遍历 功能,全部实现是标准c,移植很容易。 最新的2.6,修改了很多bug。 这个压缩包,里下载完了,直接就可以在liunx下编译安装。 如果是在windows下的话,只需要根据readme.txt的提示,修改一个小地方,就可以运行。非常方便。-minixml2.5
the latest version. Embedded xml parsing, search, generation, traversal functions, in all the standard c, transplant easily. The latest 2.5, modify a lot of bug. The compression package, download finished, you can direct the compiler is installed under the
liunx. If you are under windows, then only need to readme.txt tips, modify a small place, you can run. Very convenient.

官方下载:http://www.minixml.org/software.php

下载地址:http://sourceforge.net/projects/mxml/files/

这里有很多可以阅读的strfiles,也许你用的到,其中就包含中文手册:http://www.minixml.org/strfiles/

=============中文手册:http://www.minixml.org/strfiles/93/minixml-cn.html

感谢很多不同的开发者给我的回馈和支持, 从那以后,Mini-XML逐渐发展为一个提供更多完整的XML实现,当前已经高达3441行代码,但已经可以和103893行代码的libxml2 2.6.9版本相比较了。

译者:仅用了两天时间,作者真是大牛啊!我较喜欢Mini-XML,我也用过TinyXML,libexpat,libxml2等解析器,相比之下Mini-XML实现了一个非常简洁且功能适用的解析器,很适合我的需求:DOM型解析器、解析小型的XML文件,不进行错误恢复及校验,简单易用,且使用纯ANSI-C实现,方便移植到嵌入系统中。评价:很好很强大,而且很简单。Z.F

====使用方法:========

基本技巧 http://www.minixml.org/documentation.php/basics.html
进阶技巧 http://www.minixml.org/documentation.php/advanced.html

Mini-XML provides a single header file which you include:
#include <mxml.h>

The Mini-XML library is included with your program using the -lmxml option:
gcc -o myprogram myprogram.c -lmxml ENTER

If you have the pkg-config(1) software installed, you can use it to determine the proper compiler and linker options for your installation:
pkg-config --cflags mxml ENTER
    pkg-config --libs mxml ENTER


-------------以下是其他几个XML 开源解析库---------------------------------

1. expat xml parse

不多说了,用了就知道,比较小巧

下载地址: http://sourceforge.net/projects/expat/

2. Apache Xerces for C++ XML Parser

C++写的xml解析器 ,事实上apache还有很多java xml解析器 貌似都是提供源代码的

下载地址:http://xml.apache.org/xerces-c/download.cgi

Xerces-C++ is a validating XML parser written in a portable subset of C++. Xerces-C++ makes it easy to give your application the ability to read and write XML data. A shared library is provided for parsing, generating, manipulating,
and validating XML documents. Xerces-C++ is faithful to the XML 1.0 and 1.1 recommendations and many associated standards. The parser provides high performance, modularity, and scalability. Source code, samples and API documentation are provided with the parser.
For portability, care has been taken to make minimal use of templates, no RTTI, and minimal use of #ifdefs.

Programming LanguagesC
Categoriesxml
Mailing Listshttp://xerces.apache.org/mail.html
Bug/Issue Trackerhttps://issues.apache.org/jira/browse/XERCESC
LicenseApache License Version 2.0
Project Websitehttp://xerces.apache.org/xerces-c/
PMCApache Xerces


Project Release Information

Releases can be downloaded from http://xml.apache.org/xerces-c/download.cgi

3. The XML C parser and toolkit of Gnome

Libxml2 是一个xml c语言版的解析器,本来是为Gnome项目开发的工具,是一个基于MIT License的免费开源软件。它除了支持c语言版以外,还支持c++、PHP、Pascal、Ruby、Tcl等语言的绑定,能在Windows、Linux、Solaris、MacOsX等平台上运行。功能还是相当强大的,相信满足一般用户需求没有任何问题。

官方介绍页面:http://xmlsoft.org/downloads.html

下载地址:ftp://xmlsoft.org/libxml2/libxml2-git-snapshot.tar.gz

使用手册:ftp://xmlsoft.org/libxml2/libxml-docs.tar.gz

另外还有一个库是带xml解析的功能 叫 sfl

XML (Extensible Markup Language) access functions

Filename: sflxml.h

Package: Standard Function Library (SFL)

Written: 1998/02/25 iMatix SFL project team sfl@imatix.com

Revised: 2000/01/16

Copyright: Copyright (c) 1991-99 iMatix Corporation
官方地址:http://legacy.imatix.com/html/sfl/sfl468.htm#TOC481

比较晚了,先介绍这几个,欢迎大家互相多多交流,不管是本文的一些疑问,还是你们在使用这些解析库当中的经验都可以在这里回复评论,和我交流。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: