"Alex Martelli" <aleaxit at yahoo.com> writes: > "Harald Kirsch" <kirschh at lionbioscience.com> wrote in message > news:yv28zkm63gi.fsf at lionsp093.lion-ag.de... > [snip] > > it possible to push a pseudo root element in front of a stream parsed > > with > > > > xml.sax.parse(sys.stdin, ...) > > > If the stream fits in memory, it's clearly easy: No, it does not fit. [snip] > def wrapWith(tag, fileob): > return FileWrappedWithTag(tag, fileob) > > xml.sax.parse(wrapWith("fakedoc",sys.stdin), Handler()) > > > Fortunately, the parser just calls .read(N) on its *That* was the information I was missing. The rest is then more or less straighforward, as your example code demonstrates. Thanks, Harald Kirsch -- ----------------+------------------------------------------------------ Harald Kirsch | kirschh at lionbioscience.com | "How old is the epsilon?" LION bioscience | +49 6221 4038 172 | -- Paul Erdös *** Please do not send me copies of your posts. ***
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4