buildErrorElement function
Build an condition
type="type
" />. If text
is not null, then the condition element will contain a text
as the body.
Implementation
XMLNode buildErrorElement(String type, String condition, {String? text}) {
return XMLNode(
tag: 'error',
attributes: <String, dynamic>{'type': type},
children: [
XMLNode.xmlns(
tag: condition,
xmlns: fullStanzaXmlns,
children: [
if (text != null)
XMLNode.xmlns(
tag: 'text',
xmlns: fullStanzaXmlns,
text: text,
),
],
),
],
);
}