Re: [xml] How to extend the Reader interface with a dup() function



I want to extend the Reader interface with a dup() function.
That is, make a new reader with the same state as the current
reader, so a trial run over the data is possible.

Possible, impossible, or pointers?

  Would require special code in the xmlreader.c . Seems really hard
anyway for example if you feed the data from a socket. So In general
it sounds like too hard to make reliable and it't better to reuse 
the Reader for the same stream again.

Daniel

That would make the calling code overly complex.
In certain circumstances (XSL-FO parsing) I need to scan ahead and
then continue from the original point onwards. The documents are
-potentially- far to big to be stored in core, and rescanning to
my current position would be ugly.

I would not mind at all if the dup() would only work for files and
return NULL for other input streams. Later, perhaps, I could extend
it to other streams.

Or did you have something else in mind when you said
  "it't better to reuse the Reader for the same stream again."
?

Regards,
  NaN.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]