So decodiere ich:
Delphi-Quellcode:
var
XmlDoc : OleVariant;
Node : OleVariant;
begin
XmlDoc:= CreateOleObject(Msxml2_DOMDocument);
try
XmlDoc.Async := False;
XmlDoc.LoadXML(
{Das XML Document hier rein});
if (XmlDoc.parseError.errorCode <> 0)
then
raise Exception.CreateFmt('
Error in Xml Data %s',[XmlDoc.parseError]);
Node:= XmlDoc.documentElement;
if not VarIsClear(Node)
then
Result := TEncoding.UTF8.GetString(TEncoding.ANSI.GetBytes(
string(XmlDoc.Text)));
finally
XmlDoc:=Unassigned;
end;
end;
Kodieren geht genauso nur rückwärts.