Add method to create new DocumentElement
Brought to you by:
tpsfadmin
The code required to create a new DocumentElement without introducing a memory leak is non-obvious.
request the following be added as a new public method to TXpObjModel
function TXpObjModel.CreateDocumentElement(const sName : DOMString): TXpElement;
var
root : TXpElement;
begin
ClearDocument;
Root := Document.CreateElement(Root);
Document.AppendChild(Root); // increments Root's reference count
Root.Release; // required to prevent memory leak
result := DocumentElement;
end;