如何在c ++中读取xml文件

时间:2015-12-12 03:54:56

标签: c++ xml

我有一个包含以下代码的xml文件:

Contact.xml:

<ArrayOfPerson xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <Person>
            <ID>8a5049d9-2b1a-426f-ae15-50c8ccdc2812</ID>
            <Name>Jack</Name>
            <PhoneNumber>0125437689</PhoneNumber>
            <Key>a</Key>
            <State>false</State>
            <IsAccountBtalk>false</IsAccountBtalk>
            <IsAccountSupportBtalk>false</IsAccountSupportBtalk>
            <IsFriends>false</IsFriends>
            <IsFamily>false</IsFamily>
            <IsLock>false</IsLock>
            <Email />
            <Facebook />
            <JID>84125437689@bmail.vn</JID>
            <ImageUrl>Images/bkav_ic_avatar_default_0.png</ImageUrl>
            <IsFavorite>false</IsFavorite>
            <HasSendVCard>false</HasSendVCard>
          </Person>
          <Person>
            <ID>51ccd2c2-6ede-48d8-a93c-901a3ac6a84c</ID>
            <Name>Jony</Name>
            <PhoneNumber>015487887</PhoneNumber>
            <Key>a</Key>
            <State>false</State>
            <IsAccountBtalk>false</IsAccountBtalk>
            <IsAccountSupportBtalk>false</IsAccountSupportBtalk>
            <IsFriends>false</IsFriends>
            <IsFamily>false</IsFamily>
            <IsLock>false</IsLock>
            <Email />
            <Facebook />
            <JID>8415487887@bmail.vn</JID>
            <ImageUrl>Images/bkav_ic_avatar_default_1.png</ImageUrl>
            <IsFavorite>false</IsFavorite>
            <HasSendVCard>false</HasSendVCard>
          </Person>
          <Person>
            <ID>b8e5d059-c015-45ef-9826-c6b90bdbb463</ID>
            <Name>Shyn</Name>
            <PhoneNumber>0123456789</PhoneNumber>
            <Key>A</Key>
            <State>false</State>
            <IsAccountBtalk>false</IsAccountBtalk>
            <IsAccountSupportBtalk>false</IsAccountSupportBtalk>
            <IsFriends>false</IsFriends>
            <IsFamily>false</IsFamily>
            <IsLock>false</IsLock>
            <Email />
            <Facebook />
            <JID>84123456789@bmail.vn</JID>
            <ImageUrl>Images/bkav_ic_avatar_default_2.png</ImageUrl>
            <IsFavorite>false</IsFavorite>
            <HasSendVCard>false</HasSendVCard>
          </Person>
</ArrayOfPerson>

如何阅读此XML? 如何通过电话号码并取回佩戴者的名字呢? 例如:0125437689 =&gt;结果:杰克

0 个答案:

没有答案