type t = [ ]Errors reported by the parsers. A few of these are also used by the writers.
`Decoding_error (bytes, encoding)is reported by the decoders in moduleEncoding. For example, if the UTF-8 decoder encounters a bare0xA0byte, it will report`Decoding_error ("\xA0", "utf-8").
`Bad_token (token, where, s)is reported when there is a "local" problem with the syntax of the input stream, such as an invalid character or a duplicate attribute. For example, if the XML parser detects a&that is not part of an entity reference while reading an attribute, it will report`Bad_token ("&", "attribute", "replace with '&'")
`Unexpected_eoi whereis reported by the parsers when the input ends before an item, such as a tag, element, or comment, is closed.wheredescribes the kind of item that wasn't closed.
`Bad_document sis reported by the parsers when there is a problem with the top-level structure of the document. For example, if you are parsing an input stream as XML with~context:`Document, and the parser finds an element after the root element, it will report`Bad_document "not allowed after root element".
`Unmatched_start_tag nameand`Unmatched_end_tag nameare reported when tags aren't properly balanced. Note that not all unbalanced tags are parse errors in HTML.
`Bad_namespace sis reported by parsers when the prefixscan't be resolved to a namespace, and by the writers when the namespacescan't be resolved to a prefix (or the default namespace).
`Misnested_tag (what, where)is reported by the HTML parser when a tag appears where it is not allowed. For example, if the input has a<body>tag inside a<p>tag, the parser will report`Misnested_tag ("body", "p").
`Bad_content whereis reported by the HTML parser if an element has content it is not allowed to have. For example, if there is stray text at the top level of a<table>element, the parser will report`Bad_content "table".