Returning 0 is correct end of data signal.

/ Erik

-----Original Message-----
From: Coursimault, Jean-marc [mailto:[EMAIL PROTECTED]]
Sent: den 5 december 2001 17:59
To: '[EMAIL PROTECTED]'
Subject: RE: Incremental /progressive parsing


Hello,
I need to give the input data one buffer at a time to Xerces.
I don't know in advance the length of the input data.
I cannot give it all at once to Xerces either.

I was thinking of deriving a "MyInputStream" from a BinInputStream and
getting the data inside readBytes, but what is the "right" way to signal the
end of the data ?

By returning 0 from readBytes (which is the length of available data, I
gather) ? or by throwing an exception ?

Thanks
-- Jean-Marc
____________________________________________________________
Jean-Marc Coursimault         |
Xerox Research Centre Europe  | Tel   +33 (0)4 76 61 51 82
Advanced Technology & Systems | Mob.  +33 (0)6 12 39 65 12
6, chemin de Maupertuis       | Fax   +33 (0)4 76 61 51 99
38240 Meylan (France)         | mail : [EMAIL PROTECTED]


>> My application can only provide a buffer at a time to Xerces,
>> not a whole
>> file neither a buffer containing the whole document.
>> How can I feed Xerces that way (as in expat, XML_parse() does ?)
>> ==>expat :
>> ==>XML_Parse(XML_Parser p,const char *s,int len, int isFinal)
>> ==>Parse some more of the document.
>> ==>The string s is a buffer containing part (or perhaps all) of the
>> document.
>>
>> I don't see anyhting suitable in the API doc

> From: Erik Rydgren [mailto:[EMAIL PROTECTED]]

> In the YourInputStream::ReadBytes method let WT wait for data
> from the main thread.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to