简体   繁体   中英

Pass character stream to libxml2

I have a XML document which is received as a character stream. I wish to parse this using libxml2. Well one way would be to save it as an .xml and then open it using one of the libxml2 API's. Is there a way i can directly build a tree on this stream and parse it ?

Env is purely c++/c.

Cheers!

You can use xlmCtxtReadFd from parser.h. There's also xmlCtxtReadMemory , if you would rather use a block of memory than a stream.

根据您的上下文,尝试xmlCtxtReadFdxmlCtxtReadIO

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM