C#解析XML超长字符串的问题!高分求助!!
我不太了解XML,现有如下字符串在 <itemData> ... </itemData> ,中有100件物品,请教各位如何批量获取每件物品的属性,并根据itemInfo,对ACCESS执行SQL语句?
字符串是连在一起的,为了查看方便,我写成如下格式。
<root>
<iteminfo>
<add key= "actionWord " value= "insert " />
<add key= "itemNum " value= "100 " />
</iteminfo>
<itemData>
<cell item= "1 ">
<add key= "frequency " value= "1 " />
<add key= "itemname " value= "AAAA " />
<add key= "color " value= "4 " />
<add key= "level " value= "37 " />
<add key= "type " value= "DX " />
<add key= "lengh " value= "4 " />
<add key= "p1 " value= "you5 " />
<add key= "p2 " value= "xia2 " />
<add key= "p3 " value= "tou2 " />
<add key= "p4 " value= "kui1 " />
<add key= "p5 " value= " " />
<add key= "p6 " value= " " />
<add key= "p7 " value= " " />
<add key= "p8 " value= " " />
<add key= "p9 " value= " " />
<add key= "p10 " value= " " />
</cell>
<cell item= "2 ">
<add key= "frequency " value= "1 " />
<add key= "itemname " value= "XXXX " />
<add key= "color " value= "4 " />
<add key= "level " value= "37 " />
<add key= "type " value= "ADD " />
<add key= "lengh " value= "4 " />
<add key= "p1 " value= "you5 " />
<add key= "p2 " value= "xia2 " />
<add key= "p3 " value= "tou2 " />
<add key= "p4 " value= "kui1 " />
<add key= "p5 " value= " " />
<add key= "p6 " value= " " />
<add key= "p7 " value= " " />
<add key= "p8 " value= " " />
<add key= "p9 " value= " " />
<add key= "p10 " value= " " />
</cell>
.........
</itemData>
</root>
------解决方案--------------------只能说用XmlDocument,XPath
------解决方案--------------------