How to parse multiple XML documents from a single stream?

I have a socket from which I am reading XML data. However, this socket will spit out several different XML documents, so I can’t just parse all the output I get.

Is there a good way, preferably using the Python standard library, for me to parse multiple XML documents? In other words, if I end up getting

<foo/>
<bar/>

that is, is there a way to either get multiple DOM objects, or just use a SAX parser for such a stream?

+3
source share
1 answer

, - ; , , .

, XML , ( ) .

+4

Source: https://habr.com/ru/post/1771515/


All Articles