Class XmlParserStream

java.lang.Object
org.opendaylight.yangtools.yang.data.codec.xml.XmlParserStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

@Beta public final class XmlParserStream extends Object implements Closeable, Flushable
This class provides functionality for parsing an XML source containing YANG-modeled data. It disallows multiple instances of the same element except for leaf-list and list entries. It also expects that the YANG-modeled data in the XML source are wrapped in a root element. This class is NOT thread-safe.

Due to backwards compatibility reasons, RFC7952 metadata emitted by this parser may include key QNames with empty URI (as exposed via LEGACY_ATTRIBUTE_NAMESPACE) as their QNameModule. These indicate an unqualified XML attribute and their value can be assumed to be a String. Furthermore, this extends to qualified attributes, which uses the proper namespace, but will not bind to a proper module revision -- these need to be reconciled with a particular SchemaContext and are expected to either be fully decoded, or contain a String value. Handling of such annotations is at the discretion of the user encountering it: preferred way of handling is to either filter or normalize them to proper QNames/values when encountered. This caveat will be removed in a future version.