Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-03

possible bug in TDOMNamedNodeMap.RemoveNamedItem

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexander Todorov
Hello folks,
I found that TDOMNamedNodeMap.RemoveNamedItem does not delete from
memory the specified Item. It just sets FParentNode := nil. In this
case the following doesn't work as expected :
//-------------------------
while Node.Attributes.Length > 0 do
   Node.Attributes.RemoveNamedItem(Node.Attributes.Item[0].NodeName);
//-------------------------
// working example
while Node.Attributes.Length > 0 do
   Node.Attributes.Delete(0);
//--------------------------

This loop continues forever being stuck at the first attribute of a xml node. Is this a bug or it is by design?

Reply by email