1、expat庫簡介
refer to wiki:
To use the Expat library, programs first register handler functions with Expat. When Expat parses an XML document, it calls the registered handlers as it finds relevant tokens in the input stream. These tokens and their associated
handler calls are called events. Typically, programs register handler functions for XML element start or stop events and character events. Expat provides for more sophisticated event handling such as XML Namespace declarations, processing instructions and
DTD events.
Expat is parsing events resemble the events defined in the Simple API for XML (SAX), but Expat is not a SAX-compliant parser. Projects incorporating the Expat library often build SAX and possibly DOM parsers on top of Expat. While Expat is mainly a stream-based
(push) parser, it supports stopping and restarting parsing at arbitrary times, thus making the implementation of a pull parser relatively easy as well.
爲了使用Expat庫,程序首先在Expart中住一個處理器函數(handler functions) 。當Expat解析XML文檔時,發現輸入流中有相關的令牌會調用已經註冊的處理器(handlers) ,這些令牌(tokens)和其先關的處理器(handler)被稱作事件。通常情況下, 程序會爲XML元素中的開始事件、停止事件、字符事件(character events)註冊處理函數。Expat提供了 更多複雜事件處理,例如XML命名空間聲明,處理指令和DTD事件。
(第一次翻譯,翻譯的不好啊~~~)
說白了 ,Expat是一個面向流的xml解析器。
2、expat庫的交叉編譯
expat-2.0.1.tar.gz
./configure --host=arm-none-linux-gnueabi --prefix=/root/Qt/output/qt-arm/
make && make install