1
0
mirror of https://github.com/Kirill/simplexml.git synced 2025-07-16 18:54:23 +02:00

Library unloads 'null' variant values as '{{null}}' string. But it can't load this string as null value back. It loads this string as an ordinary string value.

Problem is solved by add new function:
 function GetVarVal(aValue: TXmlString): Variant;
This function is used in
procedure TXmlNode.SetAttr(const aName, aValue: TXmlString);
and
procedure TXmlNode.SetAttr(aNameID: Integer; const aValue: TXmlString);

Signed-off-by: Andrey Matveev <dvorkin.zilog@gmail.com>
This commit is contained in:
Andrey Matveev
2011-10-25 17:40:37 +04:00
parent 3c82c2fb87
commit 487ee6e2cc

View File

@ -2642,14 +2642,20 @@ begin
Set_Text(aValue)
end;
function GetVarVal(aValue: TXmlString): Variant;
begin
if aValue = XSTR_NULL then Result := null
else Result := aValue
end;
procedure TXmlNode.SetAttr(const aName, aValue: TXmlString);
begin
SetVarAttr(FNames.GetID(aName), aValue)
SetVarAttr(FNames.GetID(aName), GetVarVal(aValue))
end;
procedure TXmlNode.SetAttr(aNameID: Integer; const aValue: TXmlString);
begin
SetVarAttr(aNameID, aValue)
SetVarAttr(aNameID, GetVarVal(aValue))
end;
procedure TXmlNode.SetBoolAttr(aNameID: Integer; aValue: Boolean);