Xml
1. xml file format
<?xml version= "1.0" encoding= "Utf-8"?>
<NodeList>
<node text= "GWGL" ></Node>
<node text= "manual filing" clsid= "header" >
<name>gwgl. Ep_pre_ems3_cus_head</name>
<Value>TRADE_CODE</Value>
</Node>
<node text= "manual Record" clsid= "single loss" >
<name>gwgl. Ep_pre_ems3_cus_consume</name>
<Value>TRADE_CODE</Value>
<Value>EXG_NO</Value>
<Value>IMG_NO</Value>
</Node>
</NodeList>
2, read the XML file function
<summary>
reading XML files
</summary>
<param name= "Name" > node name </param>
<param name= "ClassID" > Extended options Category </param>
<param name= "Dataobj" > Data source </param>
public void ReadXML (string Name, String classid, DataRowView dataobj)
{
Try
{
XmlDocument doc = new XmlDocument ();
Doc. Load (Application.startuppath + "\\Configure.xml");
XmlNodeList node = doc. selectSingleNode ("NodeList"). ChildNodes;
XmlNode TargetNode = null;
string s = node[0]. attributes["Text"]. Value;
for (int i = 1; i < node. Count; i++)
{
if (node[i). attributes["Text"]. Value = = Name
&& Node[i]. attributes["CLSID"]. Value = = ClassID)
{
TargetNode = Node[i];
Break
}
}
if (TargetNode!= null)
{
This.toolStrip1.Visible = true;
Count = Targetnode.ChildNodes.Count;
List = new String[count];
for (int j = 0; J < Count; J +)
{
LIST[J] = Targetnode.childnodes[j]. InnerText;
}
extendtable = list[0];
for (int i = 1; i < Count; i++)
//{
Columnname[i] = List[i];
//}
GetData (dataobj, s);
}
}
catch (Exception e)
{
MessageBox.Show (E.tostring ());
}
}