diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2006-01-12 09:03:06 +0300 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2006-01-12 09:03:06 +0300 |
commit | e2e89695a1f1cfc871fe05fb1b429f1b6c969193 (patch) | |
tree | d785e345d774cbaae58b50498bb530884402cbbb /mcs/class/System.XML/System.Xml/XmlTextWriter.cs | |
parent | 15aacde4bd237d2d79a1f000c98b4181564932c2 (diff) |
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.
* XmlTextWriterTests.cs : Split AutoCreatePrefixes() and marked as
Ignore rather than NotWorking. Also it is not for bug #77086 and
#77077 (they were fixed). See bug #77088.
svn path=/trunk/mcs/; revision=55418
Diffstat (limited to 'mcs/class/System.XML/System.Xml/XmlTextWriter.cs')
-rw-r--r-- | mcs/class/System.XML/System.Xml/XmlTextWriter.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mcs/class/System.XML/System.Xml/XmlTextWriter.cs b/mcs/class/System.XML/System.Xml/XmlTextWriter.cs index 0dd0ffc1921..061d259b364 100644 --- a/mcs/class/System.XML/System.Xml/XmlTextWriter.cs +++ b/mcs/class/System.XML/System.Xml/XmlTextWriter.cs @@ -797,7 +797,7 @@ openElements [openElementCount - 1]).IndentingOverriden; string formatPrefix = ""; if (ns != String.Empty && prefix != "xmlns") { - string existingPrefix = namespaceManager.LookupPrefix (ns, false); + string existingPrefix = GetExistingPrefix (ns); if (existingPrefix == null || existingPrefix == "") { bool createPrefix = false; @@ -852,6 +852,15 @@ 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 { |