load XML file into Hash table

Posted by Chvlsru under ASP.NET on 7/19/2013 | Points: 10 | Views : 1065 | Status : [Member] | Replies : 2
Hi,

Can some one suggest me how to load xml file into hashtable with key valu pair...

Thanks,
Sruthi




Responses

Posted by: Phagu007 on: 7/19/2013 [Member] Starter | Points: 25

Up
0
Down
You can use this given code as guideline for load XML file into Hash table
PS> $xml = [xml]"<doc><element1>Example</element1><element1>Bar</element1></doc>"
PS> $xml.doc

Chvlsru, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jitendrasoft09 on: 7/20/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi,
You can load xml file into hashtable with below code-

mlDocument xoDoc = new XmlDocument();
xoDoc.Load("YourXmlFile.xml");

HashTable hTable = new HashTable();
hTable.Add ("MyXmlDocument", xoDoc);


Hope you are clear.

Jitendra Kumar
If my post helps you, plz mark as an answer.

Chvlsru, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response