[Mono-list] XmlWriter failing to write xmlns declaration

tferch tom.h.ferch at gmail.com
Wed Jun 15 15:35:38 EDT 2011


Using System.Xml.XmlWriter, I had a strange problem with writing the
namespace declaration into the file. The line:

writer.WriteAttributeString("xmlns", NCXNamespace,
“http://www.w3.org/2000/xmlns/”, NCXNamespaceURI);

was crashing with the exception:
"Invalid attribute namespace for namespace declaration."

It would appear that this exception should only be thrown if the namespace
URI does not match the proper string, but the provided string
(“http://www.w3.org/2000/xmlns/”) should be the proper match. 

Any insights on why this was occurring?

--
View this message in context: http://mono.1490590.n4.nabble.com/XmlWriter-failing-to-write-xmlns-declaration-tp3600347p3600347.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list