So as the title says, I'm trying to write multiple attributes to one tag however, I keep running into errors:
writer.WriteAttributeString("xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9");
writer.WriteAttributeString("xsi", "schemaLocation", null, "http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd");
writer.WriteAttributeString("xmlns", "xsi", "http://www.sitemaps.org/schemas/sitemap/0.9", "http://www.w3.org/2001/XMLSchema-instance");
Is what I'm using.
The first line gives this error:
System.Xml.XmlException: The prefix '' cannot be redefined from '' to 'http://www.sitemaps.org/schemas/sitemap/0.9' within the same start element tag.
And if you remove it the third line gives this:
System.ArgumentException: Prefix "xmlns" is reserved for use by XML.
Anyone got any ideas? I see no reason for this happening.