|
-
Mar 8th, 2010, 06:04 AM
#1
Thread Starter
New Member
Add xmlns to node
hi
im using the following
Dim _xdoc As New Xml.XmlDocument
Dim _xmlString As New System.Text.StringBuilder
_xmlString.Append("<configuracao'")
_xmlString.Append("<oracle>")
_xmlString.Append("<utilizador>tony</utilizador>")
_xmlString.Append("<palavrapasse>tony</palavrapasse>")
_xmlString.Append("<instancia>MYINSTANCE</instancia>")
_xmlString.Append("<enderecoservidor>10.1.1.1</enderecoservidor>")
_xmlString.Append("</oracle>")
_xmlString.Append("</configuracao>")
_xdoc.LoadXml(_xmlString.ToString())
Dim xmldecl As Xml.XmlDeclaration
xmldecl = _xdoc.CreateXmlDeclaration("1.0", "Windows-1252", "yes")
Dim root As Xml.XmlElement = _xdoc.DocumentElement
_xdoc.InsertBefore(xmldecl, root)
_xdoc.Save("CONFIGURACAO.xml")
this is working fine for me and it produces this document :
<?xml version="1.0" encoding="Windows-1252" standalone="yes" ?>
<configuracao>
<oracle>
<utilizador>tony</utilizador>
<palavrapasse>tony</palavrapasse>
<instancia>MYINSTANCE</instancia>
<enderecoservidor>10.1.1.1</enderecoservidor>
</oracle>
</configuracao>
i would like to have the xmlns add to the first node
<?xml version="1.0" encoding="Windows-1252" standalone="yes" ?>
<configuracao xmlns="urn:OECD:StandardAuditFile-Tax:PT_1.01_01">
<oracle>
<utilizador>tony</utilizador>
<palavrapasse>tony</palavrapasse>
<instancia>MYINSTANCE</instancia>
<enderecoservidor>10.1.1.1</enderecoservidor>
</oracle>
</configuracao>
any ideas ? thks in advanced
rgds
rui
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|