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

On Fri, Oct 7, 2011 at 15:21, Rob Eisink <reisreg hotmail com> 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>

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.

    <Device>John Doe</Device>

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 <andrew w nosenko gmail com>

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