diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2005-12-26 17:33:20 +0300 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2005-12-26 17:33:20 +0300 |
commit | d120a4fc6e3ca5c8b202173e1a34d77d3d12b3de (patch) | |
tree | 28fd0e3f6187081d4abed0ab802f01e912323e85 /mcs/class/System.XML/System.Xml | |
parent | bf5bf0e19ff1dbb8be770f3827ac897e93407f5d (diff) |
2005-12-26 Atsushi Enomoto <atsushi@ximian.com>
* XmlElement.cs : patch for Prefix property by Vorobiev Maksim.
- null should cause ArgumentNullException.
- "" should not raise an error.
- throws ArgumentException when it is readonly.
* XmlElementTests.cs : Patch by Vorobiev Maksim.
- setting null to Prefix should raise ArgumentNullException.
- setting String.Empty to Prefix should be allowed.
svn path=/trunk/mcs/; revision=54849
Diffstat (limited to 'mcs/class/System.XML/System.Xml')
-rw-r--r-- | mcs/class/System.XML/System.Xml/ChangeLog | 7 | ||||
-rw-r--r-- | mcs/class/System.XML/System.Xml/XmlElement.cs | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog index 0edca49b732..60c36089104 100644 --- a/mcs/class/System.XML/System.Xml/ChangeLog +++ b/mcs/class/System.XML/System.Xml/ChangeLog @@ -1,3 +1,10 @@ +2005-12-26 Atsushi Enomoto <atsushi@ximian.com> + + * XmlElement.cs : patch for Prefix property by Vorobiev Maksim. + - null should cause ArgumentNullException. + - "" should not raise an error. + - throws ArgumentException when it is readonly. + 2005-12-23 Atsushi Enomoto <atsushi@ximian.com> * XmlTextWriter.cs : When xml:space or xml:lang attribute was diff --git a/mcs/class/System.XML/System.Xml/XmlElement.cs b/mcs/class/System.XML/System.Xml/XmlElement.cs index 1ba651f6185..b008b0c0ff1 100644 --- a/mcs/class/System.XML/System.Xml/XmlElement.cs +++ b/mcs/class/System.XML/System.Xml/XmlElement.cs @@ -215,8 +215,10 @@ namespace System.Xml get { return name.Prefix; } set { if (IsReadOnly) - throw new XmlException ("This node is readonly."); - if (!XmlChar.IsNCName (value)) + throw new ArgumentException ("This node is readonly."); + if (value == null) + throw new ArgumentNullException("Prefix value is null."); + if ((!String.Empty.Equals(value))&&(!XmlChar.IsNCName (value))) throw new ArgumentException ("Specified name is not a valid NCName: " + value); value = OwnerDocument.NameTable.Add (value); |