3 ms·
Yes, you can parse XML that way, but you shouldn't. It's more work than you originally thought. Example: I've tried two parts of the xml syntax, <?xml version=
by perlgeek 15y ago
Yes, you can parse XML that way, but you shouldn't. It's more work than you originally thought.
Example: I've tried two parts of the xml syntax, <?xml version="1.0"?> and namespaces <foo:bar />, and it didn't seem to parse either. (At least if I understood the output right, it doesn't say "parsed" or "not parsed").
So it's the typical "author's idea of xml" parser, not xml parser.
- evincarofautumn 15y agoIt doesn’t handle self-closing tags, but that’s not the point. It would be trivial to add that, but again, that’s not the point. The point is that you probably don’t want to do this with regular expressions, even though, contrary to popular opinion, you pretty much can. The article even calls the solution “slow and overspecified, but still kinda neat”.
- Ives 15y agoSelf closing tags are to the best of my knowledge not a part of XML.