package DOM.Core.Elements is
...
procedure Set_Attribute
(Elem : Element; Name : DOM_String; Value : DOM_String);
-- Set the value of a specific attribute. The attribute is created if it
-- doesn't exist yet.
^^^^^^^^^^^^^^^^
But the procedure creates a new attribute every time, even if it already exists.
with DOM.Core.Documents;
with DOM.Core.Elements;
procedure XMLBug is
Imp : DOM.Core.DOM_Implementation;
Doc : DOM.Core.Document;
Root : DOM.Core.Element;
begin
Doc := DOM.Core.Create_Document (Imp);
Root := DOM.Core.Documents.Create_Element (Doc, "data");
loop
DOM.Core.Elements.Set_Attribute (Root, "bug", "memory leak");
end loop;
end XMLBug;
But the procedure creates a new attribute every time, even if it already exists.