dart-xml
dart-xml copied to clipboard
Parse attribute without value
I want to parse a html document but I get the error Unhandled Exception: XmlParserException: ">" expected at 17:140
.
<script nonce="a" defer src="/core/js/oc.js?v=e23870b"></script>
defer
is not a valid XML attribute.
Generally HTML documents cannot be parsed by an XML parser, as HTML has much more relaxed rules with regards to attributes and nesting/closing tags.
This is a pity. Do you have an alternative?
Parsing of incomplete attributes like in the above example could be supported. However dealing with HTML tags is very complicated.
I would look for a HTML parser, I think there is a Dart package that does that?