canonicalizeElement function

Uint8List canonicalizeElement(
  1. XmlLiteElement element, {
  2. required XmlC14nMethod method,
  3. XmlLiteElement? omit,
  4. List<String> inclusivePrefixes = const [],
})

Canonicalizes the subtree rooted at element as a document subset: the namespaces it inherits from its ancestors are rendered on it as needed.

Implementation

Uint8List canonicalizeElement(XmlLiteElement element,
    {required XmlC14nMethod method,
    XmlLiteElement? omit,
    List<String> inclusivePrefixes = const []}) {
  final out = StringBuffer();
  _Canonicalizer(method, omit, inclusivePrefixes)
      .element(element, out, apex: true);
  return Uint8List.fromList(utf8.encode(out.toString()));
}