[System.Xml.Linq] xmlns prefixes are no longer generated in some cases.
authorMarcos Henrich <marcos.henrich@xamarin.com>
Fri, 12 Dec 2014 19:07:33 +0000 (19:07 +0000)
committerMarcos Henrich <marcos.henrich@xamarin.com>
Fri, 12 Dec 2014 19:50:15 +0000 (19:50 +0000)
commitaad3c917e41f4dc319117a6c42d12b34d8e5bdaf
tree667e591d831d1e40a82aa4514697e5da0ab80986
parent2039c7d499cf113016a6feba4f3596072a33e843
[System.Xml.Linq] xmlns prefixes are no longer generated in some cases.
  - XNodeWrite.FillXmlns was adding a prefix to the attribute when no prefix was found (prefix==null)

  - XNodeWrite.LookupPrefix now returns string.Empty prefix when the namespace is the same as the element.
    A string.Empty prefix explicitly states that it has no prefix whereas null states that prefix was not defined.
    When LookupPrefix returns null for a namespace it means that a prefix should be generated first for anything that uses the namespace.
    That is what XmlSerializationWriter.GetQualifiedName does.

Fixes #24300
mcs/class/System.Xml.Linq/System.Xml.Linq/XNodeWriter.cs