+++ to secure your transactions use the Bitcoin Mixer Service +++

 

Nmap Development mailing list archives

Re: PostgreSQL patch


From: Brett Hutley <brett () hutley net>
Date: Tue, 09 Jul 2002 13:52:04 +1000

Max Schubert wrote:

Forwarding this to the list ... Jean-Marc corrected my comment about SAX working
with streams ... thank you.

Yes, but a lot of C parser aren't free/open...
I know some, most known is Expat... But, to work, it have to get the =
whole file/string, even if it does a sax-based parsing...


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.

Cheers, Brett



---------------------------------------------------------------------
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: