From d0d1b1e4ad57bab735424ff7b7c33e2a41c83b1a Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Fri, 28 Nov 2003 16:59:28 +0000 Subject: [PATCH] 2003-11-28 Atsushi Enomoto * XmlAttribute.cs : set_Prefix checks value when existing is "xmlns". svn path=/trunk/mcs/; revision=20592 --- mcs/class/System.XML/System.Xml/ChangeLog | 4 ++++ mcs/class/System.XML/System.Xml/XmlAttribute.cs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog index e53b27dca53f0..c1311661a601d 100644 --- a/mcs/class/System.XML/System.Xml/ChangeLog +++ b/mcs/class/System.XML/System.Xml/ChangeLog @@ -1,3 +1,7 @@ +2003-11-28 Atsushi Enomoto + + * XmlAttribute.cs : set_Prefix checks value when existing is "xmlns". + 2003-11-28 Atsushi Enomoto * XmlWriter.cs : patch by Gonzalo (I modified a bit). WriteNode() diff --git a/mcs/class/System.XML/System.Xml/XmlAttribute.cs b/mcs/class/System.XML/System.Xml/XmlAttribute.cs index 696bbcd4f5050..dd1906646d9b2 100644 --- a/mcs/class/System.XML/System.Xml/XmlAttribute.cs +++ b/mcs/class/System.XML/System.Xml/XmlAttribute.cs @@ -161,6 +161,8 @@ public class XmlAttribute : XmlNode throw new XmlException ("This node is readonly."); if (!XmlChar.IsNCName (value)) throw new ArgumentException ("Specified name is not a valid NCName: " + value); + if (prefix == "xmlns" && value != "xmlns") + throw new ArgumentException ("Cannot bind to the reserved namespace."); prefix = value; }