toXml method
Implementation
@override
void toXml(XmlBuilder context, NamespaceManager nsmgr) {
final Map<String, String?> namespaces;
final namespace = this.namespace;
switch (namespace) {
case null:
namespaces = const {};
case "":
namespaces = const {"": null};
default:
if (!nsmgr.contain(namespace)) {
namespaces = {namespace: nsmgr.generate(namespace)};
} else {
namespaces = const {};
}
}
context.element(name, namespace: namespace, namespaces: namespaces);
}