Nmap Development mailing list archives

Re: XML output, SAX and nmap [was Re: PostgreSQL patch]


From: "Max Schubert" <musitechman () earthlink net>
Date: Tue, 09 Jul 2002 05:55:44 -6756

Hi Bret,

Bret wrote:

Actually, I think expat WILL work with streams.
Here is the prototype from xmlparse.h:

/* Parses some input. Returns 0 if a fatal error is detected.
The last call to XML_Parse must have isFinal true;
len may be zero for this call (or any other). */
int XMLPARSEAPI XML_Parse(XML_Parser parser, const char *s, int len, int 
isFinal);

So... basically you read from your stream to a buffer. Call XML_Parse 
with isFinal set to 0 with your buffer, and repeat until you reach 
end-of-stream. You're callbacks will be called as expat parses the input.

Yes, after a little research and catching up on my own (it had been months since I had
done any work with XML) I found out that Jean-Marc had mispoken .. I contacted him about 
it and he apologized for mispeaking ... said he doesn't know English that well and he 
didn't mean to say that most parsers have to read the whole doc/string in first ..

Thanks for the clarification regarding expat.

Max

---------------------------------------------------------------------
For help using this (nmap-dev) mailing list, send a blank email to 
nmap-dev-help () insecure org . List run by ezmlm-idx (www.ezmlm.org).



Current thread: