开发者

error at tinyxml when deserialize

开发者 https://www.devze.com 2023-03-23 06:48 出处:网络
I have the following xml: <Name /> <Sur> mmm </Sur> When I deserialize I wrote: TiXmlElement* section;

I have the following xml:

<Name />
<Sur> mmm </Sur>

When I deserialize I wrote:

TiXmlElement* section;
section=handle.Firs开发者_如何学GotChild("Name").ToElement()
if (section) {}

The problem is that the if condition is runned though field Name is null. WHY? Where am I wrong? Appreciate. THX


Maybe you should define a root element of your XML code, like <Person>:

<Person>
    <Name />
    <Sur> mmm <Sur />
</Person>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号