I'm trying to write out an XML file from VB and have it
mostly done, but I need the following header and can't
seem to get the right syntax for the WriteAttributeString
methods to get this result.
<fsaAtlasData xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
xsi:noNamespaceSchemaLocation="d:/fsaATLAS/XML/SASStudent.
xsd">
I tried the following but got the error shown below it.
.WriteStartElement("fsaAtlasData")
.WriteAttributeString
("xmlns", "xsi", "http://www.w3.org/2001/XMLSchema-
instance")
.WriteAttributeString
("xsi", "noNamespaceSchemaLocation", "d:/fsaATLAS/XML/SASS
tudent.xsd")
Unhandled Exception: System.ArgumentException:
The 'xmlns' attribute is bound to the reserved
namespace 'http://www.w3.org/2000/xmlns/'.
at System.Xml.XmlTextWriter.WriteStartAttribute(Strin g
prefix, String localName, String ns)
at System.Xml.XmlWriter.WriteAttributeString(String
localName, String ns, String value)
at fsaXML.fsaXML.Main(String[] args) in C:\My
Projects\fsaXML\fsaXML.vb:line 72