Hi Alek,

Aleksander Slominski <[EMAIL PROTECTED]> wrote on 04/01/2007 10:10:44 
AM:

> hi Wei,
> 
> i have implemented pull parser on top of Xerces XNI using above approach
> however i discovered that /parse(false) /will *not* parse exactly one
> event it is closer to parseSome() - you never know so you need to buffer
> them in potentially very large stack (unlimited grow size)

In general this is true but if the parser configuration used by the 
XMLStreamReader is fixed to a specific implementation (like 
XML11Configuration) you can avoid a lot of copying if you recognize the 
places where the parser stops (like after scanning a start-tag or end-tag) 
and also when it overwrites its internal buffers (you can defer array 
copying).

> or run parsing in separate thread and use blocking queueu with limited 
> capacity and have pull parser read events fromit in user thread.

The SAX to StAX converter is implemented like that (out of necessity). 
Been awhile since I've looked at it but with all the thread 
synchronization I wouldn't expect that it performs very well.

> for details you can checkout my code from CVS at
> http://sourceforge.net/projects/xni2xmlpull/
>
> best,
> 
> alek
> 
> -- 
> The best way to predict the future is to invent it - Alan Kay
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

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

Reply via email to