Next article: http://keleyi.com/a/bjac/ttssua0f.htm
In the previous article, we provided code for the C # XML file operation class XmlHelper and an example of using this class, that is, using the XmlHelper class to create an xml document.
This article adds nodes to the xml document created in the previous article.
The Code is as follows:
XmlHelper m_menu_keleyi_com = new XmlHelper ();
Hashtable m_ht = new Hashtable ();
M_ht.Add ("url", "http://keleyi.com/menu/csharp ");
M_ht.Add ("text", "C #");
Return m_menu_keleyi_com.InsertNode (@ "D: \ kel" + "eyimenu. xml", "csharp", true, "keleyimenu", m_ht, null );
Of course, you need to reference the namespace:
Using Keleyi. Com. XmlDAL;
Result The content of the xml file keleyimenu. xml is:
<? Xml version = "1.0" encoding = "UTF-8"?>
<Keleyimenu>
<Csharp text = "C #" url = "http://keleyi.com/menu/csharp/"/>
</Keleyimenu>
Original article: http://keleyi.com/a/bjac/0avt4d6l.htm