Hi andrew,

when I call  call xmlTextReaderReadString() i got a lof of \n in the buffer, 
indeed then the value I looking for but als
the value of the all the text elements ir presume :-(
So when the xml looks like 
<Device>John Doe</Device>
<Xxxxxx>Hello</Xxxxx>
<Yyyyyy>Worl</Yyyyyy>

I get "\n(31 spaces)John Doe\nHello\nWorld\n"

This is not exactly what I wanted. :-(

Rob
> Date: Fri, 7 Oct 2011 13:35:02 +0300
> From: [email protected]
> To: [email protected]
> CC: [email protected]
> Subject: Re: [xml] Fwd: Value out of ellement?
> 
> On Thu, Oct 6, 2011 at 18:13, Csaba Raduly <[email protected]> wrote:
> > Forward to the list too
> > ---------- Forwarded message ----------
> > From: Csaba Raduly <[email protected]>
> > Date: Thu, Oct 6, 2011 at 5:12 PM
> > Subject: Re: [xml] Value out of ellement?
> > To: Rob Eisink <[email protected]>
> >
> >
> > 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
> > XML_READER_TYPE_END_ELEMENT for </Device>
> >
> > 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().
> 
> -- 

> Date: Fri, 7 Oct 2011 13:35:02 +0300
> From: [email protected]
> To: [email protected]
> CC: [email protected]
> Subject: Re: [xml] Fwd: Value out of ellement?
> 
> On Thu, Oct 6, 2011 at 18:13, Csaba Raduly <[email protected]> wrote:
> > Forward to the list too
> > ---------- Forwarded message ----------
> > From: Csaba Raduly <[email protected]>
> > Date: Thu, Oct 6, 2011 at 5:12 PM
> > Subject: Re: [xml] Value out of ellement?
> > To: Rob Eisink <[email protected]>
> >
> >
> > 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
> > XML_READER_TYPE_END_ELEMENT for </Device>
> >
> > 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 <[email protected]>
> _______________________________________________
> xml mailing list, project page  http://xmlsoft.org/
> [email protected]
> http://mail.gnome.org/mailman/listinfo/xml
                                          
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to