| ▲ | mickeyp 11 hours ago | |
Because SAX parsing is a thing, and the visitor pattern makes it easy to elide searches in sub-trees if an attribute does not match. So if name == "foobar" then read; else ignore. For a 500 GiB XML file that makes a difference. As for your other point about an "AST" (it's actually just a DOM.) That's the the benefit? And you're in for a surprise when you learn that reaching into a deeply-nested JSON structure deserialised into whatever memory format most appropriate for your pet language is also an abstract data type that you act on with getters/accessors/what-have-yous that is in all but name a DOM. And we do have tools to deal with it: XSLT for transformation. For querying? XPath. | ||