How can i fix this?
Tdm = class(TDataModule) HTTP: TIdHTTP; XMLDoc: TXMLDocument; ... var sStory: String; ... sStory:= GetHTTP('http://localhost/MultiPlay_PHP/contentlesson.php'); begin xmlDoc.XML.Text := sStory; xmlDoc.Active :=true; StartItemNode := XMLDoc.DocumentElement.ChildNodes.First; ANode := StartItemNode;
The error begins with the code xmlDoc.Active.
<?xml version="1.0" encoding="UTF-8" ?> - <WORDSET> - <WORD NUMBER="1"> <ENGLISH>beat</ENGLISH> <KOREAN>두드리다</KOREAN> </WORD>
Project.exe raised an EDOMParseError exception class with the message "An invalid character was found in text content. But when I remove Korean characters from XML, then the code is fine.
, http Indy. URL-, ( , , GetHTTP). xml , LoadFromStream TXMLDocument. TXMLDocument , .
LoadFromStream
TXMLDocument
, , contentlesson.php, XML ( ). , , , , , .
, - UTF-8. , sStory: String sStory : UTF8string
sStory: String
sStory : UTF8string
, .
var sStory : Utf8String; begin sStory := '<?xml version="1.0" encoding="UTF-8" ?>' + '<WORDSET>' + '<WORD NUMBER="1">' + '<ENGLISH>beat</ENGLISH>' + '<KOREAN>두드리다</KOREAN>' + '</WORD>' + '</WORDSET>'; xmlDoc.XML.Text := sStory; xmlDoc.Active := true; end;
Source: https://habr.com/ru/post/1751336/More articles:How can I mask display driver drawing commands in Mac OS X? - graphicsWhy is the Date header not set when I do WebRequest in C #? - c #How to insert a primary key value explicitly? - ruby-on-railsHow to convert TLE information to latitude and longitude for display on a Bing map? - silverlightApp store testing app with inapp purchase function - iphoneLine spacing in winform RichTextBox - c #Java: capturing sound - javaHow to make the image rotate around a fixed point when using a bitmap? - androidHow to create your own function in jQuery? - jqueryCan I copy a table to another table with an equal sign? If not, how? - c #All Articles