Re: [gdome]Question gdome test program
- From: Luca Padovani <lpadovan cs unibo it>
- To: jameshu utstar com
- Cc: Gdome mailing list <gdome gnome org>, lpadovan cs unibo it
- Subject: Re: [gdome]Question gdome test program
- Date: Tue, 23 Dec 2003 11:12:34 +0100
Hi,
On Tue, 2003-12-23 at 09:54, jameshu utstar com wrote:
> I compile gdome using VC.
> And meet a problem when running \test\bench.c
>
> it is broken down in traversal()
> because the ownerDoc is NULL after call gdome_xml_n_unref
the test works for me.
However I see a problem for sure which is the domdoc variable has type
GdomeDocument but it is casted to GdomeElement for the first call to
traversal! For some gdome2 magic this should cause no harm but anyway
I've corrected the code in CVS (see patch attached).
In case you're still experiencing the problem (likely), would you be
able to generate a stack trace?
Cheers,
-- luca
Index: bench.c
===================================================================
RCS file: /cvs/gnome/gdome2/test/bench.c,v
retrieving revision 1.3
diff -r1.3 bench.c
66c66
< void traversal (GdomeElement *el) {
---
> void traversal (GdomeNode *n) {
72,78c72,77
< child = gdome_el_firstChild (el, &exc);
<
< while(child) {
< type = gdome_n_nodeType (child, &exc);
< switch (type) {
< case GDOME_ELEMENT_NODE:
< printElHead ((GdomeElement *)child);
---
> type = gdome_n_nodeType (n, &exc);
> switch (type) {
> case GDOME_ELEMENT_NODE:
> printElHead ((GdomeElement *)n);
> child = gdome_n_firstChild (n, &exc);
> while(child) {
80,86c79,81
< printElFoot ((GdomeElement *)child);
< break;
< case GDOME_TEXT_NODE:
< str = gdome_t_data ((GdomeText *)child, &exc);
< printf (str->str);
< gdome_str_unref (str);
< break;
---
> temp = gdome_n_nextSibling (child, &exc);
> gdome_n_unref (child, &exc);
> child = temp;
88,90c83,89
< temp = gdome_n_nextSibling (child, &exc);
< gdome_n_unref (child, &exc);
< child = temp;
---
> printElFoot ((GdomeElement *)n);
> break;
> case GDOME_TEXT_NODE:
> str = gdome_t_data ((GdomeText *)n, &exc);
> printf (str->str);
> gdome_str_unref (str);
> break;
91a91
>
96a97
> GdomeElement* root;
111,112c112,114
< traversal ((GdomeElement *)domdoc);
<
---
> root = gdome_doc_documentElement(domdoc, &exc);
> traversal ((GdomeNode*) root);
> gdome_el_unref(root, &exc);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]