【急】解析XML串的问题,请大家帮忙,解决了就结贴!!!
我用XMLDocument来解析XML文件没有问题,文件的基本格式是这样的:
<?xml version="1.0" encoding="UTF-8"? >
<OETest name="36" type="22" >
<option content="parent1" >
<item id="55" text="测试1" > </item >
<item id="56" text="测试2" > </item >
</option >
<option content="parent1" >
<item id="4" text="考试" > </item >
</option >
</OETest >
但是,现在我收到的是XML字符串,就是把上面的内容拼成串,这样的话我把XMLDocument.XML.Text赋值成这个串就解析不出来了,找不到结点了好像,请教各位这是怎么回事?或者有其他方法可以解决这个问题吗?着急啊,解决了就结贴!!!谢谢~~
串是这样的: <?xml version="1.0" encoding="UTF-8"? > <OETest name="36" type="22" > <option content="parent1" > <item id="55" text="测试1" > </item > <item id="56" text="测试2" > </item > </option > <option content="parent1" > <item id="4" text="考试" > </item > </option > </OETest >