Some simple facts about XML (一)
2009-09-30 18:24
465 查看
libxml2是个不错的跨平台库。另外最近还简单试了一个tinyxml,很好用,不过很快放弃了。通常这些库都把整个XML放到内存里,parse成树结构,接下来各种处理都很方便。因为需要处理上百M的单个XML文件,载入就花很多时间。
现在知道的libxml2中用xmlTextReaderPtr可以实时读取。有用的函数就几个:
- xmlReaderForFile 打开文件
- xmlTextReaderRead 顺序读每个结点
- xmlTextReaderConstName 读取结点
- xmlTextReaderGetAttribute 读取属性
写xml也是几个简单的就够了
- xmlTextWriterStartDocument 打开文件
- xmlTextWriterStartElement
- xmlTextWriterEndElement
- xmlTextWriterWriteAttribute
- xmlTextWriterWriteFormatAttribute
- xmlTextWriterEndDocument
下面的文章讲的很好
C++的XML编程经验――LIBXML2库使用指南
http://www.blogjava.net/wxb_nudt/archive/2009/07/25/161340.html
博主新地址
http://blog.csdn.net/wxb_nudt/archive/2008/09.aspx
Libxml2 is the XML parser and toolkit written in the C language
Libxml2 was originally developed for the Gnome project, but doesn't have any dependencies on it or even the Linux platform
Libxml2 implements a number of existing standards related to markup languages.
The majors are: XML standard 1.0 including Namespaces, Base, URI, XPointer, XInclude, XPath, HTML 4.0 parser, Canonical XML 1.0, XML Schemas Part 2, xml:id, and XML Catalog working drafts.
Libxml2 includes basic FTP and HTTP clients so you don't have to write an extra layer of code just to find your documents. Libxml2 exports Push (progressive) and Pull (blocking) type parser interfaces for both XML and HTML. Libxml2 can do DTD validation at parse time, using a parsed document instance, or with an arbitrary DTD. Sister projects provide some additional goodies like XSLT 1.0 (from libxslt) and a DOM2 implementation is also in the works.
Useful Links
Libxml2: Everything You Need in an XML Library
http://www.developer.com/xml/article.php/3729826/Libxml2-Everything-You-Need-in-an-XML-Library.htm
http://www.zlatkovic.com/libxml.en.html
现在知道的libxml2中用xmlTextReaderPtr可以实时读取。有用的函数就几个:
- xmlReaderForFile 打开文件
- xmlTextReaderRead 顺序读每个结点
- xmlTextReaderConstName 读取结点
- xmlTextReaderGetAttribute 读取属性
写xml也是几个简单的就够了
- xmlTextWriterStartDocument 打开文件
- xmlTextWriterStartElement
- xmlTextWriterEndElement
- xmlTextWriterWriteAttribute
- xmlTextWriterWriteFormatAttribute
- xmlTextWriterEndDocument
下面的文章讲的很好
C++的XML编程经验――LIBXML2库使用指南
http://www.blogjava.net/wxb_nudt/archive/2009/07/25/161340.html
博主新地址
http://blog.csdn.net/wxb_nudt/archive/2008/09.aspx
Libxml2 is the XML parser and toolkit written in the C language
Libxml2 was originally developed for the Gnome project, but doesn't have any dependencies on it or even the Linux platform
Libxml2 implements a number of existing standards related to markup languages.
The majors are: XML standard 1.0 including Namespaces, Base, URI, XPointer, XInclude, XPath, HTML 4.0 parser, Canonical XML 1.0, XML Schemas Part 2, xml:id, and XML Catalog working drafts.
Libxml2 includes basic FTP and HTTP clients so you don't have to write an extra layer of code just to find your documents. Libxml2 exports Push (progressive) and Pull (blocking) type parser interfaces for both XML and HTML. Libxml2 can do DTD validation at parse time, using a parsed document instance, or with an arbitrary DTD. Sister projects provide some additional goodies like XSLT 1.0 (from libxslt) and a DOM2 implementation is also in the works.
Useful Links
Libxml2: Everything You Need in an XML Library
http://www.developer.com/xml/article.php/3729826/Libxml2-Everything-You-Need-in-an-XML-Library.htm
http://www.zlatkovic.com/libxml.en.html
相关文章推荐
- some simple facts about XML (三)
- Some simple facts about XML (二)
- Some interesting facts about static member functions in C++
- Some interesting facts about static member functions in C++
- android graphic(18)—How about some Android graphics true facts?
- 转:Some interesting facts about SharePoint 2007 Search
- Some facts about topological sort
- How about some Android graphics true facts
- Some interesting facts about static member functions in C++
- Some useful information about Active Directory help tool
- some tips about shell variables
- Note-1:simple bakefile xml
- some ideAs About steAlth for rootkit
- some articles about linear-Z buffer and W-buffer
- 【转载】 Some tutorials about CGAL
- Just a simple case about the oracle 11gR1 dataguard configuration
- simple build.xml
- Some really good discussions about material/shader system on gamedev.net
- some thinking about management
- Some points about postback and multi-language drop down list