473,320 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

C# - How to add a new node at xmldoc.DocumentElement.ChildNodes - level?

42
I'm completely new to xml-manipulation in C#.
I have an XmlDocument (xmldoc) and want to add a new element (node)
to the xmldoc.DocumentElement.ChildNodes.
How do I achieve that?

Thanks!
Nov 7 '07 #1
2 2567
MimiMi
42
Gaaaahh.. found it out myself.
I totally missed that the xmldoc.DocumentElement has an AppendChild - method!
Sorry!
Nov 7 '07 #2
r035198x
13,262 8TB
Gaaaahh.. found it out myself.
I totally missed that the xmldoc.DocumentElement has an AppendChild - method!
Sorry!
That's why I always refuse to write a single line of code until I have the specs available with me.
Nov 7 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: fremenusul | last post by:
I orginally asked this question on friday, and made some progress, but now I am getting an error. What is the type of xmlProductName (check the runtime type in the debugger)? The debug output...
1
by: Rafaela K. Azinhal | last post by:
Please, help me with following code snippet ' Load xml document Dim xmlDoc As New XmlDocument() xmlDoc.Load(http://localhost/VT/reports/VT_actual_owsPivotTable.xml) ' define namespacemanager...
8
by: chris yoker via DotNetMonster.com | last post by:
hiya, I succesfully return a "nodeList" thru the "xmlDoc.SelectNodes" method. This nodeList is taken from a repetitive, uniform xml doc. I can successfully append a child node at the correct...
14
by: neerajb | last post by:
Hi, I am having an XML document(input.xml) which is showing the menu heirarchy used in my application.My requirement is to add "submenu" tag to those menuitems who are having the child menuitems...
4
by: crmpicco | last post by:
I am trying to delete all 'PiccoOption' nodes that i do not need, i then want to put the document, with just one 'PiccoOption' into the form field 'document.form.optionNumber.value'. This code...
0
by: RJN | last post by:
Hi I have to read an xml and add the node elements into a hashtable with nodename as key and nodetext as value. If the selected node has childnodes, then value should go as an array. for eg.,...
1
by: Que | last post by:
hi i have the following xml document <root> <item> <key> <scode></scode> </key> <scode></scode> <desc></desc> <pc></pc>
4
by: sitemap | last post by:
Hello. I have a problem to accessing the right clindNodes from the xml. I have many "step" elements with id. I want to get the attributes from the 5 "matrix" elements, depending on parent...
2
by: npm | last post by:
I'm trying to display XML nodes whose parent node has a certain attribute (or attribute value). I have one code that works in Firefox, but not IE and another code that works in IE, but not Firefox. ...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.