from static method

XmlCdata? from(
  1. String string, {
  2. bool trimWhitespace = true,
})
override

Returns string as an CDATA node. string must not be null.

If trimWhitespace is true, unnecessary whitespace between nodes will be removed and all remaining whitespace will be replaced with a single space. trimWhitespace must not be null.

Returns null if no CDATA sections are found.

Implementation

static XmlCdata? from(
  String string, {
  bool trimWhitespace = true,
}) {
  return StringParser.from<XmlCdata>(
    input: string,
    delimiter: Delimiters.cdata,
    getNode: _getCdata,
    trimWhitespace: trimWhitespace,
  );
}