Lots XML broken?
Derek Atkins
warlord@MIT.EDU
24 May 2002 22:42:20 -0400
Linas,
I'm receiving numerous copies of this error when I load my data file:
** CRITICAL **: file gnc-account-xml-v2.c: line 341 (account_lots_handler): assertion `node->xmlChildrenNode' failed.
Looking at my data file, I see XML that looks like this:
<gnc:account version="2.0.0">
<act:name>Bank</act:name>
<act:id type="guid">4df4e3900361605091bbfbe420de7d28</act:id>
<act:type>BANK</act:type>
<act:commodity>
<cmdty:space>ISO4217</cmdty:space>
<cmdty:id>USD</cmdty:id>
</act:commodity>
<act:commodity-scu>100</act:commodity-scu>
<act:slots>
<slot>
<slot:key>placeholder</slot:key>
<slot:value type="string">false</slot:value>
</slot>
<slot>
<slot:key>notes</slot:key>
<slot:value type="string"></slot:value>
</slot>
</act:slots>
<act:lots/>
</gnc:account>
Obviously node->xmlChildrenNode is going to be NULL if there are no
lots in the account. Perhaps the XML generation code should look like
this (in src/backend/file/gnc-account-xml-v2.c, around line 131):
n = xaccAccountGetLotList (act);
if (n)
{
toaddto = xmlNewChild (ret, NULL, act_lots_string, NULL);
for ( ; n; n=n->next)
{
GNCLot * lot = n->data;
xmlAddChild (toaddto, gnc_lot_dom_tree_create (lot));
}
}
-derek
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord@MIT.EDU PGP key available