开发者

read from stdin for libxml2 in C

I would like to know the best way to parse a large amount of xml from stdin (data getting piped) into a program I am writing using libxml2. I can parse fine using a reader from the function xmlTextReaderPtr reader = xmlNewTextReaderFilename(filename) when I hav开发者_如何学Goe a char * to the name of the file. I would preferably like to wind up with a reader so the rest of my program remains the same.

Thank you.


I believe the best thing to do is to use the opening function that contains a file descriptor as the parameter and pass STDIN_FILENO.

http://www.xmlsoft.org/html/libxml-xmlreader.html#xmlReaderNewFd

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜