Why is XML hard to parse? I was chatting with a friend about my love/hate relationship with XML.  He made the comment that, &quot;xml is broken primarily because parsers for recursive self-defined document are basically impossible to get right.&quot;
I've heard the critique that XML is very difficult to parse before, but my understanding is limited to difficulties around balancing memory usage (i.e. streaming) and the impedance mismatch between XML and most programming languages (such as not supporting basic primitives like an array).
What is unique about XML as a self-defining document that makes parsing difficult?
Thanks for posting your question! See, normally parsers implement huge usage of regex or regular expressions. But regular expressions are just for text manipulation and cannot count. Because of this defect of regular expressions, it becomes quite difficult to balance number of open and close tags. Hence, software engineers have to do some extra work to deal with it. You can read more about regular expressions at Mozilla Developer Network Docs and at this post on Medium.