By writing this
Dim AiD As XmlElement = myXML.CreateElement("ns8:AiD", aNamespace)
AiD.InnerText = "myInnerText"
AiD.SetAttribute("xsi:type", "ns17:anObject")
AiD.SetAttribute("xmlns:ns17", "http://aLink")
AiD.SetAttribute("xmlns:xsi", "http://anotherLink")
WR.AppendChild(AiD)
I want my XML file to contain this:
<ns8:AiD xsi:type="ns17:anObject" xmlns:ns17=http://aLink xmlns:xsi=http://anotherLink>myInnerText</ns8:AiD>
Unfortunately, it contains this:
<ns8:AiD type="ns17:anObject" xmlns:ns17="http://aLink" xmlns:xsi="http://anotherLink">myInnerText</ns8:AiD>
So quotation marks are included and ‘xsi:’ is missing. I have already read that quotation marks are not bad. But why is ‘xsi:’ missing ?
The functions are the usual .NET System.Xml functions. MyXML
is a System.XML.XmlDocument.