XmlParser constructor

XmlParser()

A parser for XML configuration files.

Converts XML elements to nested maps, with attributes prefixed by '@' and text content stored under '#text'. Preserves special property values like #{} and @{} for later resolution.

Example usage:

void main() {
  final parser = XmlParser();

  final config = parser.parse('<root><child>value</child></root>');
  print(config['root']['child']); // Output: value

  final config = parser.parseAsset(asset);
  print(config['root']['child']); // Output: value

  final config = parser.parseFile('config.xml');
  print(config['root']['child']); // Output: value
}

Implementation

XmlParser();