Re: [gdome] setAttribute segv



Maybe a better question is why would my elements vtab->setAttribute be NULL?

I modified the gdom.c example as follows which produces the following output:
root->vtab =  0x80cbea0 root->vtab->setAttribute = (nil)

8<------8<------8<-----

/* examplea.c */

#include "libgdome/gdome.h"
#include "libgdome/gdomecore/gdome-xml-node.h"
#include "libgdome/gdomecore/gdome-xml-element.h"

int main (int argc, char **argv) {
       GdomeDOMImplementation *domimpl;
       GdomeDocument *doc;
       GdomeElement *root, *el;
       GdomeText *txtnode;
       GdomeException exc;
       GdomeNode *result;
       GdomeDOMString *name, *value;

       /* First I get a DOMImplementation reference */
       domimpl = gdome_di_mkref ();

       /* I create a new document with TEST as root element */
       name = gdome_str_mkref ("TEST");
       doc = gdome_di_createDocument(domimpl, NULL, name, NULL, &exc);
       if (doc == NULL) {
fprintf (stderr, "DOMImplementation.createDocument: failed\n\tException #%d\n", exc);
               return 1;
       }
       gdome_str_unref (name);

       /* I get reference to the root element of the document */
       root = gdome_doc_documentElement (doc, &exc);
       if (root == NULL) {
fprintf (stderr, "Document.documentElement: NULL\n\tException #%d\n", exc);
               return 1;
       }

       printf("root->vtab =  %p root->vtab->setAttribute = %p\n",
          root->vtab,
          root->vtab->setAttribute);
fflush(0);






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