I am using XMLDocument to create my xml. How do I remove the
namespace information ? It is being put on all my xml nodes:
<MyServ xmlns="http://www....../XInclude>
<Timeout xmlns="">100</Timeout
<MyServ>
I am using CreateElement as such
xElem = newXMLConfigDoc.CreateElement("Timeout")
xElem.InnerText = "100"
rootNode.AppendChild(xElem)
What am I doing wrong ??
> I am using XMLDocument to create my xml. How do I remove the
> namespace information ? It is being put on all my xml nodes:
>
> <MyServ xmlns="http://www....../XInclude>
> <Timeout xmlns="">100</Timeout
> <MyServ>
Const XiNs As String = "http://www.w3.org/2000/xmlns/"
Dim XmlDoc As XmlDocument = New XmlDocument
XmlDoc.AppendChild(XmlDoc.CreateElement("MyService"))
Dim XiAttribute As XmlAttribute =
XmlDoc.CreateAttribute("xmlns", "xi", XiNs)
XiAttribute.Value = "http://www.w3.org/2003/XInclude"
XmlDoc.DocumentElement.SetAttributeNode(XiAttribute)
Dim Timeout As XmlElement = XmlDoc.CreateElement("Timeout")
Timeout.InnerText = "100"
XmlDoc.DocumentElement.AppendChild(Timeout)

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/