Re: [xml] printing the value of a namespace



On Mon, 2003-03-10 at 15:20, Nick Torenvliet wrote:
My code looks like this


xmlChar *out
cur = xmlDocGetElementRoot(doc);
printf("%s\n",cur->name);

and it give a seg fault.  


No way to tell why it's segfaulting from the snippet given. This minimal
test case works:

******************************************

#include <libxml/parser.h>

int
main(int argc, char **argv) {

        xmlDocPtr doc;
        xmlNodePtr cur;

        doc = xmlParseFile("test.xml");
        cur = xmlDocGetRootElement(doc);

        printf("%s\n", cur->name);
        return 0;
}

******************************************

Cheers,
John
-- 
John Fleck
jfleck inkstain net (h) jfleck abqjournal com (w)
http://www.inkstain.net http://www.abqjournal.com
http://www.gnome.org/learn/users-guide/latest/

"Sliced bread wasn't an innovation. Sliced pizza was. I mean, can you
 imagine eating a family sized unsliced pizza?"
 - Jeff Waugh




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