Re: [xml] Fwd: Value out of ellement?

On Thu, Oct 6, 2011 at 18:13, Csaba Raduly <rcsaba gmail com> wrote:
Forward to the list too
---------- Forwarded message ----------
From: Csaba Raduly <rcsaba gmail com>
Date: Thu, Oct 6, 2011 at 5:12 PM
Subject: Re: [xml] Value out of ellement?
To: Rob Eisink <reisreg hotmail com>

On Thu, Oct 6, 2011 at 5:03 PM, Rob Eisink  wrote:
Let me more clear..

The xml looks like <Device>JohnDoe</Device>
I call name = xmlTextReaderName(reader);

the name is Device

That means you are on a XML_READER_TYPE_ELEMENT.

When you use the xml reader, your xml line will appear as three nodes:
XML_READER_TYPE_ELEMENT          for <Device>
XML_TEXT_READER_TEXT                   for JohnDoe

You need to call xmlTextReaderRead to move to the XML_TEXT_READER_TEXT
node, then call xmlTextReaderValue

As slightly simpler alternative: just move Reader to the <Device> node
and call xmlTextReaderReadString().

Andrew W. Nosenko <andrew w nosenko gmail com>

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]