Open vladchuk opened 1 year ago
You can define your own entity mapping:
const entityMapping = XmlDefaultEntityMapping({
'joy': '😂',
'tears': '😢',
});
final document = XmlDocument.parse('<xml>&joy; and &tears;</xml>',
entityMapping: entityMapping);
print(document.rootElement.innerText); // prints '😂 and 😢'
The doctype entities are already parsed to some extent, but mapping them automatically is non-trivial and requires a lot of work. Happy to take contributions in this area.
Currently, there is no way (or at least it's not clear how) to create a mapping of custom entities from the XML document. For example:
Please add support for parsing doctype entities, so that they can be referenced within containing XML.