X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Security%2FSystem.Security.Cryptography.Xml%2FDataObject.cs;h=bd7c529f137bc5e3138abfe4dea4d64b819e3783;hb=097409cdab4f046189c17d4bd9490c8aecbc5ef4;hp=a21acd42932539bf93122751661cbe682ff7a5ec;hpb=2007998771b1c4d9e762943676d7959daaf74385;p=mono.git diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/DataObject.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/DataObject.cs index a21acd42932..bd7c529f137 100644 --- a/mcs/class/System.Security/System.Security.Cryptography.Xml/DataObject.cs +++ b/mcs/class/System.Security/System.Security.Cryptography.Xml/DataObject.cs @@ -72,9 +72,7 @@ namespace System.Security.Cryptography.Xml { XmlNode newNode = document.ImportNode (data, true); xel.AppendChild (newNode); } - document.AppendChild (xel); // FIXME: it should not be appended - - element = document.DocumentElement; + element = xel; } // why is data a XmlNodeList instead of a XmlElement ? @@ -87,8 +85,8 @@ namespace System.Security.Cryptography.Xml { throw new ArgumentNullException ("value"); XmlDocument doc = new XmlDocument (); XmlElement el = (XmlElement) doc.ImportNode (element, true); - doc.AppendChild (el); // FIXME: it should not be appended - el.RemoveAll (); + while (el.LastChild != null) + el.RemoveChild (el.LastChild); foreach (XmlNode n in value) el.AppendChild (doc.ImportNode (n, true)); element = el; @@ -131,8 +129,6 @@ namespace System.Security.Cryptography.Xml { else { XmlDocument document = new XmlDocument (); XmlElement el = document.ImportNode (element, true) as XmlElement; - el.Attributes.RemoveAll (); - document.AppendChild (el); // FIXME: it should not be appended el.SetAttribute (attribute, value); element = el; propertyModified = true; @@ -146,7 +142,6 @@ namespace System.Security.Cryptography.Xml { XmlElement oldElement = element; XmlDocument doc = new XmlDocument (); element = doc.CreateElement (XmlSignature.ElementNames.Object, XmlSignature.NamespaceURI); - doc.AppendChild (element); // FIXME: it should not be appended foreach (XmlAttribute attribute in oldElement.Attributes) { switch (attribute.Name) { case XmlSignature.AttributeNames.Id: