[xml] libxml2 API crazy?
- From: Nikita Churaev <lamefun x0r gmail com>
- To: xml gnome org
- Subject: [xml] libxml2 API crazy?
- Date: Mon, 29 Apr 2013 07:30:49 +0400
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <stdio.h>
int
main (int argc, char** argv)
{
xmlDocPtr doc = xmlReadMemory("<doc/>", 6, "egg.xml", NULL, 0);
/* XmlNode */ /* XmlDoc */
printf("%s\n", (doc->children->parent == doc) ? "true" : "false");
return 0;
}
This gives out "true"... Why? xmlNode.parent is xmlNodePtr... So I can't
just rely on xmlNode pointers to actually point to xmlNode? I looked all
around the API reference and tutorials and found nothing on this topic.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]