toXml method

XmlElement toXml(
  1. String elemName, {
  2. List<XmlAttribute>? attributes,
})

Implementation

_s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) {
  final fieldDelimiter = this.fieldDelimiter;
  final quoteCharacter = this.quoteCharacter;
  final quoteEscapeCharacter = this.quoteEscapeCharacter;
  final quoteFields = this.quoteFields;
  final recordDelimiter = this.recordDelimiter;
  final $children = <_s.XmlNode>[
    if (quoteFields != null)
      _s.encodeXmlStringValue('QuoteFields', quoteFields.toValue()),
    if (quoteEscapeCharacter != null)
      _s.encodeXmlStringValue('QuoteEscapeCharacter', quoteEscapeCharacter),
    if (recordDelimiter != null)
      _s.encodeXmlStringValue('RecordDelimiter', recordDelimiter),
    if (fieldDelimiter != null)
      _s.encodeXmlStringValue('FieldDelimiter', fieldDelimiter),
    if (quoteCharacter != null)
      _s.encodeXmlStringValue('QuoteCharacter', quoteCharacter),
  ];
  final $attributes = <_s.XmlAttribute>[
    ...?attributes,
  ];
  return _s.XmlElement(
    _s.XmlName(elemName),
    $attributes,
    $children,
  );
}