can someone help me find a way to transfer data from an XML to a hashtable. I need it in a hashtable because i need to have a key value pair. The reason i also have two items per value is i need to do a rotation everythime a user goes to my site it will rotate the image. I've never done this before and not sure if it's possible. I'm using visual studios 08 in C#
XML:
located inside App_Data(cake.xml)
<cakeshop>
<items value="cake">
<item>
<image>cake1.gif</image>
<link>cake.aspx</link>
<percent>50</percent>
</item>
<item>
<image>cake2.gif</image>
<link>cake2.aspx</link>
<percent>50</percent>
</item>
</items>
<items value="donut">
<item>
<image>donut1.gif</image>
<link>donut.aspx</link>
<percent>50</percent>
</item>
<item>
<image>donut2.gif</image>
<link>donut2.aspx</link>
<percent>50</percent>
</items>
</cakeshop>
--------------------------------------------------------------------------------------------------
code is located inside the App_Code (cakerotation.cs)
public static void CakeRotation()
{
XMLDocument objGetCake = new XMLDocument();
objGetCake.Load(HttpContext.Current.Server.MapPath("~/App_Data/cake.xml"));
if (null != objGetCake)
{
//this is where I get stuck because I'm not sure how to load the XML Data inside the HashTable.
}
}
can anyone help me out?
Thanks in advance.