[xml] Getting out of xmlTextReaderReadAttributeValue mode


I'm having difficulties using xmlTextReaderReadAttributeValue. It
doesn't seem to work like the equivalent function in ECMA/.NET, at
least as implemented by Mono. Consider the following simple C#


It parses every attribute of every element that has attributes, and
for each attribute print the texts and entity references contained in
that attribute's value. In this case, it just prints "foo" and "bar",
as expected. Now, take a look at the equivalent C code using libxml2:


When I run this, it only prints "foo". What seems to happen is that
after doing xmlTextReaderReadAttributeValue(), I can't use
xmlTextReaderMoveToNextAttribute to get to the next attribute, so it
just skips to the next read.

Is there a way to get the cursor back to the attribute, so to continue
reading other attributes? Or is this a bug in libxml2?

Simon Kågedal Reimer

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