Re: Scribus filter / c# advice needed

On 01/12/06, D Bera <dbera web gmail com> wrote:
> efficiently do this using stream readers/ writers so I can just
> connect the output from that into the XmlReader and never load the
> whole thing into ram?

One way I would try is to create a BufferedStream stream and create
your XmlTextReader from it. Use a byte[] as the storage - check the
XmlTextReader source to see what buffer size they use to read from
stream. If your filter is well behaved, then it most probably be using
anything else other that Read(byte[], int offset, int count),
ReadByte(), Close(). Implement them using your internal buffer. And
whenever your read anything in your buffer, do a search and replace in
the buffer.

- dBera

Thanks for the advice, although I just tried running the filter on an
old scribus file and it seems the XmlReader is quite happy to process
xml files that are malformed in this way so it looks like there's no
need for buffering.

I've attached a tweaked version of the filter to the bugzilla page
( which is now ready
to be committed by someone.

Alex Mac

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