XmlEventDecoder constructor
XmlEventDecoder({})
Creates a new XmlEventDecoder.
If validateDocument is true, the parser validates that the root elements
of the input follow the requirements of an XML document. This means the
document consists of an optional declaration, an optional doctype, and a
single root element.
If validateNamespace is true, the parser validates the declaration and
use of namespaces and throws a XmlNamespaceException if there is a
problem.
If validateNesting is true, the parser validates the nesting of tags and
throws an XmlTagException if there is a mismatch or tags are not closed.
Again, in case of an error iteration can be resumed with the next event.
Furthermore, the following annotations can be enabled if needed:
- If
withLocationistrue, each event is annotated with the starting and stopping position (exclusive) of the event in the input buffer. - If
withNamespaceistrue, the namespace of the element is resolved and added to the event. - If
withParentistrue, each event is annotated with its logical parent event.
Implementation
XmlEventDecoder({
XmlEntityMapping? entityMapping,
this.validateDocument = false,
this.validateNamespace = false,
this.validateNesting = false,
this.withLocation = false,
this.withNamespace = false,
this.withParent = false,
}) : entityMapping = entityMapping ?? defaultEntityMapping;