DOMString is defined as DOMString in FPC 3.0.4.
function CreateTextNode(const data: DOMString): TDOMText;
And DOMString is XMLString which is WideString.
So the whole DOM and fcl-xml is still WideString oriented.
B.T.W. On january 20th 2019 the conversion from WideString -> UnicodeString is introduced in fcp-xml.
So in trunk and newer FPC version you won't get the warnings.
You are in so far right that there won't be a warning
Implicit string type conversion from "AnsiString" to "WideString". However there'll now be a warning
Warning: Implicit string type conversion from "AnsiString" to "UnicodeString". This is because an assignment does result in a conversion from either ANSI or UTF8 of the
AnsiString to UTF16 of the
UnicodeString (or
WideString in the past). This might not be what the user desires (as it might result in a performance impact, especially if the codepage of the string is not UTF8 as then the conversion will likely be ANSI -> UTF8 -> UTF16), thus this warning exists.
To solve this simply add an explicit typecast to
UnicodeString:
NameNode := XML.CreateElement(UnicodeString(aFieldName));
ValueNode := XML.CreateTextNode(UnicodeString(aFieldValue));