diff options
Diffstat (limited to 'mcs/class/System.XML/System.Xml')
-rw-r--r-- | mcs/class/System.XML/System.Xml/ChangeLog | 25 | ||||
-rw-r--r-- | mcs/class/System.XML/System.Xml/DTDObjectModel.cs | 2 | ||||
-rw-r--r-- | mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs | 4 | ||||
-rw-r--r-- | mcs/class/System.XML/System.Xml/XmlTextWriter.cs | 21 | ||||
-rw-r--r-- | mcs/class/System.XML/System.Xml/XmlWriter.cs | 9 |
5 files changed, 7 insertions, 54 deletions
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog index a2498bf3d6c..c7d7c295879 100644 --- a/mcs/class/System.XML/System.Xml/ChangeLog +++ b/mcs/class/System.XML/System.Xml/ChangeLog @@ -1,28 +1,3 @@ -2006-01-12 Atsushi Enomoto <atsushi@ximian.com> - - * XmlTextWriter.cs : Do not local duplicate of automatically-created - prefixes (i.e. check local autocreated prefixes other than - namespaces from ancestors). Fixed bug #77086 and #77087. - -2006-01-12 Atsushi Enomoto <atsushi@ximian.com> - - * XmlWriter.cs : use XmlChar.IsNmToken() to check argument and throw - ArgumentException in WriteNmTokenInternal(). - -2006-01-12 Atsushi Enomoto <atsushi@ximian.com> - - * XmlTextWriter.cs : Fixed bug #77094. Only XmlTextWriter checks - such invalid "xml" prefix which is being mapped to different - namespace URI than the predefined one. - Removed comment that does not make sense. - * XmlNamespaceManager.cs : IsValidDeclaration() could be private. - Added some comments. - -2006-01-11 Atsushi Enomoto <atsushi@ximian.com> - - * DTDObjectModel.cs : dtd2xsd fix; set use="optional" when an - attribute is #IMPLIED. - 2006-01-06 Atsushi Enomoto <atsushi@ximian.com> * XmlWriter.cs : In WriteNode(XPathNavigator, bool), Avoid diff --git a/mcs/class/System.XML/System.Xml/DTDObjectModel.cs b/mcs/class/System.XML/System.Xml/DTDObjectModel.cs index bae72caa7ba..e411b8fa08d 100644 --- a/mcs/class/System.XML/System.Xml/DTDObjectModel.cs +++ b/mcs/class/System.XML/System.Xml/DTDObjectModel.cs @@ -833,8 +833,6 @@ namespace Mono.Xml SetLineInfo (a); a.Name = Name; a.DefaultValue = resolvedNormalizedDefaultValue; - if (OccurenceType != DTDAttributeOccurenceType.Required) - a.Use = XmlSchemaUse.Optional; XmlQualifiedName qname = XmlQualifiedName.Empty; ArrayList enumeration = null; diff --git a/mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs b/mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs index 29afff1e604..ea6a8b50523 100644 --- a/mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs +++ b/mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs @@ -170,11 +170,9 @@ namespace System.Xml decls [declPos].Uri = uri; } - static string IsValidDeclaration (string prefix, string uri, bool throwException) + internal static string IsValidDeclaration (string prefix, string uri, bool throwException) { string message = null; - // It is funky, but it does not check whether prefix - // is equivalent to "xml" in case-insensitive means. if (prefix == PrefixXml && uri != XmlnsXml) message = String.Format ("Prefix \"xml\" can only be bound to the fixed namespace URI \"{0}\". \"{1}\" is invalid.", XmlnsXml, uri); else if (message == null && prefix == "xmlns") diff --git a/mcs/class/System.XML/System.Xml/XmlTextWriter.cs b/mcs/class/System.XML/System.Xml/XmlTextWriter.cs index 061d259b364..cc86640a281 100644 --- a/mcs/class/System.XML/System.Xml/XmlTextWriter.cs +++ b/mcs/class/System.XML/System.Xml/XmlTextWriter.cs @@ -752,6 +752,8 @@ openElements [openElementCount - 1]).IndentingOverriden; public override void WriteStartAttribute (string prefix, string localName, string ns) { if (prefix == "xml") { + // MS.NET looks to allow other names than + // lang and space (e.g. xml:link, xml:hack). ns = XmlNamespaceManager.XmlnsXml; if (localName == "lang") openXmlLang = true; @@ -797,7 +799,7 @@ openElements [openElementCount - 1]).IndentingOverriden; string formatPrefix = ""; if (ns != String.Empty && prefix != "xmlns") { - string existingPrefix = GetExistingPrefix (ns); + string existingPrefix = namespaceManager.LookupPrefix (ns, false); if (existingPrefix == null || existingPrefix == "") { bool createPrefix = false; @@ -852,15 +854,6 @@ openElements [openElementCount - 1]).IndentingOverriden; } } - string GetExistingPrefix (string ns) - { - if (newAttributeNamespaces.ContainsValue (ns)) - foreach (DictionaryEntry de in newAttributeNamespaces) - if (de.Value as string == ns) - return (string) de.Key; - return namespaceManager.LookupPrefix (ns, false); - } - private string CheckNewPrefix (bool createPrefix, string prefix, string ns) { do { @@ -923,14 +916,6 @@ openElements [openElementCount - 1]).IndentingOverriden; if ((prefix != null && prefix.Length > 0) && ((ns == null))) throw ArgumentError ("Cannot use a prefix with an empty namespace."); - // Considering the fact that WriteStartAttribute() - // automatically changes argument namespaceURI, this - // is kind of silly implementation. See bug #77094. - if (Namespaces && - ns != XmlNamespaceManager.XmlnsXml && - String.Compare (prefix, "xml", true) == 0) - throw new ArgumentException ("A prefix cannot be equivalent to \"xml\" in case-insensitive match."); - // ignore non-namespaced node's prefix. if (ns == null || ns == String.Empty) prefix = String.Empty; diff --git a/mcs/class/System.XML/System.Xml/XmlWriter.cs b/mcs/class/System.XML/System.Xml/XmlWriter.cs index 0010ce4c0da..3870f7e7df6 100644 --- a/mcs/class/System.XML/System.Xml/XmlWriter.cs +++ b/mcs/class/System.XML/System.Xml/XmlWriter.cs @@ -360,19 +360,16 @@ namespace System.Xml internal virtual void WriteNmTokenInternal (string name) { - bool valid = true; #if NET_2_0 switch (Settings.ConformanceLevel) { case ConformanceLevel.Document: case ConformanceLevel.Fragment: - valid = XmlChar.IsNmToken (name); - break; + XmlConvert.VerifyNMTOKEN (name); + break; } #else - valid = XmlChar.IsNmToken (name); + XmlConvert.VerifyNMTOKEN (name); #endif - if (!valid) - throw new ArgumentException ("Argument name is not a valid NMTOKEN."); WriteString (name); } |