views:

26

answers:

2

Hi,

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!

+1  A: 

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

Nathon
Thanks , xmlCtxtReadMemory looks more like what i can use... :)
Ricko M
+1  A: 

Try xmlCtxtReadFd or xmlCtxtReadIO depending on your context.

bstpierre