encodeXmlAttributeValueWithQuotes function

String encodeXmlAttributeValueWithQuotes (
  1. String input,
  2. XmlAttributeType attributeType
)

Encode a string to be serialized as an XML attribute value with quotes.

Implementation

String encodeXmlAttributeValueWithQuotes(
    String input, XmlAttributeType attributeType) {
  final quote = attributeQuote[attributeType];
  final buffer = StringBuffer();
  buffer.write(quote);
  buffer.write(encodeXmlAttributeValue(input, attributeType));
  buffer.write(quote);
  return buffer.toString();
}