技术要点:
1、基础xml解析库:tinyxml
2、XmlTree类
3、重载[],返回XmlTree类
4、实现Count函数,返回本级目录子节点的数目
针对如下的CMyString strRequestXml:(为了说明功能,把request结点分成两部分写)
<?xml version='1.0' encoding='utf-8'?> <request version = '1.0' name = 'updateMainView'> <request> <requestType>updateUI</requestType> <view> <viewType>mainView</viewType> <viewId>view_1</viewId> <event>click</event> <listView> <id>listView_mainView</id> <selectedId>item_2</selectedId> </listView> </view> </request>
原文地址:http://blog.csdn.net/lonelyrains/article/details/45093007