Hi,
I have a an xmldocument that creates an entry but with a xmlns="" attached, And because I have a validating schema it fails on this node.
code is as follows
Dim oEmailNode As XmlElement = coGLobalXMLDoc.CreateElement("Email")
' add attributes to the node
oEmailNode.SetAttribute("DisplayName", oEmail.DisplayName)
oEmailNode.SetAttribute("to", oEmail.EmailTo)
oEmailNode.SetAttribute("subject", oEmail.Subject)
oEmailNode.SetAttribute("body", oEmail.Body)
oEmailNode.SetAttribute("enabled", clbGlobalEmails.GetItemChecked(i).ToString.ToLower )
'add node to xml document
xmlNode.AppendChild(oEmailNode)
coGLobalXMLDoc.Save(Path & "\XXXXXXXX.xml")
I should see this
<Email DisplayName="XXXXXX" to="XXXX.XXXXX@XXXX.XXX" subject="XXXXXX" body="test" enabled="true" />
but i get this
<Email DisplayName="XXXXXX" to="XXXX.XXXXX@XXXX.XXX" subject="XXXXX" body="test" enabled="true" xmlns="" />
I have tried removing the xmlns attribute after the append but that doesn't work.
What do I need to do to stop this from being put in.
Cheers :confused: