problem #142
-
My original
but after this comand:
the value of doc variable is:
Look the Way this is happening? How can'i workaround this? Ps.: My string already in UTF-8 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
final document = XmlDocument.parse(input, entityMapping: XmlDefaultEntityMapping.html5()); |
Beta Was this translation helpful? Give feedback.
-
Thank you... |
Beta Was this translation helpful? Give feedback.
-
Hi... I have another document with this notation of especial entities on the body: Any way to handle this? |
Beta Was this translation helpful? Give feedback.
-
I got a workaround with the following code: var strDoc = doc.toString();
RegExp regExp = new RegExp(
r'<!ENTITY\s(.*?)\s\"(.*?)\">',
multiLine: true,
);
for (var element in regExp.allMatches(strDoc).toList()) {
var from = element.group(1);
var to = element.group(2);
strDoc = strDoc.replaceAll('&$from;', '$to');
} |
Beta Was this translation helpful? Give feedback.
is not an XML character entity. You can configure the XML parser to use HTML5 entities instead of the standard XML ones, which should correctly decode@nbsp;
to a whitespace: