Author: atsushi
Date: 2007-01-12 07:22:39 -0500 (Fri, 12 Jan 2007)
New Revision: 70916
Modified:
trunk/mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog
trunk/mcs/class/System.Security/System.Security.Cryptography.Xml/DataObject.cs
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/DataObjectTest.cs
Log:
2007-01-12 Atsushi Enomoto <[EMAIL PROTECTED]>
* DataObject.cs : don't clear attributes or children unnecessarily.
* DataObjectTest.cs : test to make sure to not clear attributes or
children unnecessarily.
Modified:
trunk/mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog
===================================================================
--- trunk/mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog
2007-01-12 11:19:23 UTC (rev 70915)
+++ trunk/mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog
2007-01-12 12:22:39 UTC (rev 70916)
@@ -1,5 +1,9 @@
2007-01-12 Atsushi Enomoto <[EMAIL PROTECTED]>
+ * DataObject.cs : don't clear attributes or children unnecessarily.
+
+2007-01-12 Atsushi Enomoto <[EMAIL PROTECTED]>
+
* SignedXml.cs : actually ComputeSignature() itself does not raise
silly exception. It always use CryptographicException.
Added another check; malformed reference object.
Modified:
trunk/mcs/class/System.Security/System.Security.Cryptography.Xml/DataObject.cs
===================================================================
---
trunk/mcs/class/System.Security/System.Security.Cryptography.Xml/DataObject.cs
2007-01-12 11:19:23 UTC (rev 70915)
+++
trunk/mcs/class/System.Security/System.Security.Cryptography.Xml/DataObject.cs
2007-01-12 12:22:39 UTC (rev 70916)
@@ -88,7 +88,8 @@
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,7 +132,6 @@
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;
Modified:
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog
===================================================================
---
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog
2007-01-12 11:19:23 UTC (rev 70915)
+++
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog
2007-01-12 12:22:39 UTC (rev 70916)
@@ -1,5 +1,10 @@
2007-01-12 Atsushi Enomoto <[EMAIL PROTECTED]>
+ * DataObjectTest.cs : test to make sure to not clear attributes or
+ children unnecessarily.
+
+2007-01-12 Atsushi Enomoto <[EMAIL PROTECTED]>
+
* SignedXmlTest.cs : fixed ComputeSignatureNoSigningKey() to not
expect silly exception. Added test for malformed reference.
Modified:
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/DataObjectTest.cs
===================================================================
---
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/DataObjectTest.cs
2007-01-12 11:19:23 UTC (rev 70915)
+++
trunk/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/DataObjectTest.cs
2007-01-12 12:22:39 UTC (rev 70916)
@@ -169,5 +169,24 @@
AssertEquals (String.Empty, el1.OwnerDocument.OuterXml);
*/
}
+
+ [Test]
+ public void SetDataAfterId ()
+ {
+ DataObject d = new DataObject ();
+ XmlElement el = new XmlDocument ().CreateElement
("foo");
+ d.Id = "id:1";
+ d.Data = el.SelectNodes (".");
+ AssertEquals ("id:1", d.Id);
+ }
+
+ [Test]
+ public void SetMimeTypeAfterId ()
+ {
+ XmlElement el = new XmlDocument ().CreateElement
("foo");
+ DataObject d = new DataObject ("id:1", null, null, el);
+ d.MimeType = "text/html";
+ AssertEquals ("id:1", d.Id);
+ }
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches