[xml] Getting out of xmlTextReaderReadAttributeValue mode
- From: Simon Kågedal Reimer <skagedal gmail com>
- To: xml gnome org
- Subject: [xml] Getting out of xmlTextReaderReadAttributeValue mode
- Date: Mon, 19 Aug 2013 22:54:58 +0200
Hi!
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#
example:
http://pastebin.com/xSbaT7cN
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:
http://pastebin.com/kCc1twyB
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?
Regards,
Simon Kågedal Reimer
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]