I have pretty big XML documents, so I don't want to use DOM, but while parsing a document with SAX parser I want to stop at some point (let's say when I reached element with a certain name) and get everything inside that element as a string. "Everything" inside is not necessary a text node, it may contain tags, but I don't want them to me parsed, I just want to get them as text.
I'm writing in Python. Is it possible to solve? Thanks!
I don't believe it's possible with the xml.sax. BeautifulSoup has SoupStrainer which does exactly that. If you're open to using the library, it's quite easy to work with.
Can I somehow tell to SAX parser to stop at some element and get its child nodes as a string?