Hi,
I was just a bit
playing around with Mono 0.13 it works quite well on my Linux
Box.
Then I
discovered that the Xml support that the Xml support lacks writing the
namespaces.
I was using
XmlDocument directly inserting XmlElement in diffrent namespaces but I just got
a file with the plain local names.
After digging' in
the sources of System.Xml I found the bug.
In
mcs-0.13\class\System.XML\System.Xml\XmlElement.cs I found the following
code:
public
override void WriteTo (XmlWriter w)
{
w.WriteStartElement(LocalName);
{
w.WriteStartElement(LocalName);
foreach(XmlNode attributeNode in
Attributes)
attributeNode.WriteTo(w);
attributeNode.WriteTo(w);
WriteContentTo(w);
w.WriteEndElement();
}
}
Which just emits the
Xml element without prefix nor namespace, the fix was quite
simple:
public
override void WriteTo (XmlWriter w)
{
attributeNode.WriteTo(w);
{
w.WriteStartElement(Prefix, LocalName,
NamespaceURI); // FIXED
foreach(XmlNode attributeNode in
Attributes)attributeNode.WriteTo(w);
WriteContentTo(w);
w.WriteEndElement();
}
}
After recompiling
System.Xml.dll xml namespaces are correctly written.
Thanks for the
really amazing work you're all doing with mono.
I would be very
pleased if you can add this fix the the official mono
source.
Thanks,
Marcus
Buergel
