doctype method
Adds a XmlDoctype node.
For example, to generate an XML doctype element <!DOCTYPE note SYSTEM "note.dtd">
one would write:
builder.doctype('note', systemId: 'note.dtd');
Implementation
void doctype(String name,
{String? publicId, String? systemId, String? internalSubset}) {
if (publicId != null && systemId == null) {
throw ArgumentError(
'A system ID is required, if a public ID is provided');
}
final externalId = publicId != null && systemId != null
? DtdExternalId.public(publicId, XmlAttributeType.DOUBLE_QUOTE,
systemId, XmlAttributeType.DOUBLE_QUOTE)
: publicId == null && systemId != null
? DtdExternalId.system(systemId, XmlAttributeType.DOUBLE_QUOTE)
: null;
_stack.last.children.add(XmlDoctype(name, externalId, internalSubset));
}