Bill wrote:
[color=blue]
> 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")[/color]
You are trying to bind "xmlns" prefix to "xsi" namespace URI, that's wrong and
after all forbidden, because "xmlns" is special reserved attribute name and
cannot be bound to any namespace URI other than "http://www.w3.org/2000/xmlns/".
[color=blue]
> .WriteAttributeString
> ("xsi", "noNamespaceSchemaLocation", "d:/fsaATLAS/XML/SASS
> tudent.xsd")[/color]
C# code:
writer.WriteAttributeString("xmlns", "xsi", null,
"http://www.w3.org/2001/XMLSchema-instance");
writer.WriteAttributeString("xsi", "noNamespaceSchemaLocation",
"http://www.w3.org/2001/XMLSchema-instance",
"d:/fsaATLAS/XML/SASStudent.xsd");
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel