4 ms·
Every specific counterexample can be countered with a specifically tailored countersolution. If you only need to parse a certain subset of an XML document, then
by evincarofautumn 15y ago
Every specific counterexample can be countered with a specifically tailored countersolution. If you only need to parse a certain subset of an XML document, then you don’t need to parse XML, and (ordinary) regular expressions will work.
Also, the article does say that you can parse well-formed XML with a single regex, you just can’t validate it that way.
- SimHacker 15y agoBy "just fine" do you mean "not quite"? You missed the part about the first job of a parser being "check for correct syntax": http://en.wikipedia.org/wiki/Parser http://en.wikipedia.org/wiki/Parser Parser In computing, a parser is one of the components in an interpreter or compiler, which checks for correct syntax and builds a data structure (often some kind of parse tree, abstract syntax tree or other hierarchical structure) implicit in the input tokens. The parser often uses a separate lexical analyser to create tokens from the sequence of input characters. Parsers may be programmed by hand or may be (semi-)automatically generated (in some programming languages) by a tool.