On Fri, Oct 7, 2011 at 15:21, Rob Eisink <[email protected]> wrote:
> 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. :-(
>
xmlTextReaderReadString() collects string value of current node and
all its descendands. Therefore, if called on the node 'Device' as
described it will return 'John Doe'. Just bnecause
<Device>John Doe</Device>
has no descendands.
"John Doe Hello Worl" (or similar) you be obtained because called
xmlTextReaderReadString() on the parent node of the 'Device' node.
<parent>
<Device>John Doe</Device>
<Xxxxxx>Hello</Xxxxx>
<Yyyyyy>Worl</Yyyyyy>
</parent>
Or, as alternative, you could to obtain such results if 'Xxxxxx' and
'Yyyyyy' nodes aren't siblinds (as you written in example) but
descendands indeed in your real-live document.
PS. Please, don't top-post in technical-related mailing lists.
--
Andrew W. Nosenko <[email protected]>
_______________________________________________
xml mailing list, project page http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml