Re: [gnome-db] database xml - xml database new from uri



Hi,

Sorry, I was unable to check out the release-1-0-branch, so I didn't
make a patch, but the correction is easy to do.

Phil

Still in the function "xml_database_new_from_uri" :

When using the function "database =
gda_xml_database_new_from_uri(filename);" to read an existing XML
database, the following errors appear :

  ** (program:12636): WARNING **: add_xml_row(): there are missing
values on the XML node

  ** (program:12636): CRITICAL **: file gda-value.c: line 826
(gda_value_free): assertion `value != NULL' failed

  ** (program:12636): CRITICAL **: file gda-value.c: line 826
(gda_value_free): assertion `value != NULL' failed
 
  ** (program:12636): WARNING **: Could not add the data from the XML
node
 
  ** (program:12636): WARNING **: add_xml_row(): there are missing
values on the XML node
 
  ** (program:12636): CRITICAL **: file gda-value.c: line 826
(gda_value_free): assertion `value != NULL' failed

  ** (program:12636): WARNING **: Could not add the data from the XML
node

>From all those error messages, the first one seems to be the important
as the other ones are just caused by "add_xml_row(): there are missing
values on the XML node".

After some search, it seems that in the file "gda_data_model.c", in the
function "add_xml_row()", line 939, there is a test "if (!strcmp
(xml_field->name, "value")) continue;".  The purpose of this test is, I
suppose, a seek for "<value>".  The problem, is that when "<value>" is
found, the function does nothing with it.
If you change the test in "if (strcmp (xml_field->name, "value"))
continue;", it works.

The only "problem" is that strange XML files may be accepted :

     <data>
      <row position="0">
       <foo>bar</foo>
       <value position="0" gdatype="string">EBBR</value>
       <value position="1" gdatype="string">BRU</value>
      </row>
     </data>

The "for" loop finds "<foo>", disregads it ("if (strcmp
(xml_field->name, "value")) continue;") and continues to find the 2
"<value>".




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