[Gnucash-changes] r13713 - gnucash/trunk - Work around the fact that a validating XML parser barfs on gnucash's

Chris Shoemaker c.shoemaker at cox.net
Thu Mar 30 14:26:48 EST 2006


On Thu, Mar 30, 2006 at 02:12:39PM -0500, David Hampton wrote:
> On Thu, 2006-03-30 at 13:15 -0500, Chris Shoemaker wrote:
> 
> > What happened here?  I've been seeing these printf's for quite a while
> > and I've been meaning to track down why the 'loaded' numbers are less
> > than the 'total' numbers for several data-types. 
> 
> There are multiple reasons why the percentage loaded value could exceed
> 100%.  The simplest is that a bad count value was written on output.  If
> you were able to successfully load your data file you weren't hitting
> the problem I fixed.
> 
> The problem I was seeing is related to the following (class of) line in
> the data file:
> 
>   <gnc:count-data cd:type="commodity">161</gnc:count-data>
> 
> Gnucash writes the <gnc:count-data> tag with an attribute named
> 'cd:type' but doesn't declare the 'cd' namespace.  (The declaration of
> 'cd' that you see on line 6 of the data file is in the wrong scope.)
> When a validating xml parser reads this attribute it on input, it
> ignores the attribute leaving gnucash with no idea of what the number
> 161 applies to.  This was considered a parse error and caused the
> loading of the data file to be considered a failure even though all the
> data was read.  Also since all counts to be loaded are zero, gnucash has
> no way to properly update the progress bar.  

Right, I know I'm not hitting that bug.

> > But why remove them?  Are they invalid in some way?
> 
> They're debugging that was left in by accident by yours truly a long
> time ago.  My test data file was yielding 1,800 passes through that
> code, producing close to 10,000 lines of output.  If you still want this
> output you can enable debugging for GNC_MOD_IO.

For as long as I can remember, I've seen this output exactly thrice for
every book load, i.e. GnuCash session. Here's typical output:

gnucash: [M] "Found Finance::Quote version "1.11
Transactions: Total: 535, Loaded: 547
Accounts: Total: 114, Loaded: 113
Books: Total: 1, Loaded: 0
Commodities: Total: 0, Loaded: 0
Scheduled Tansactions: Total: 11, Loaded: 9
Budgets: Total: 1, Loaded: 0
Transactions: Total: 535, Loaded: 547
Accounts: Total: 114, Loaded: 113
Books: Total: 1, Loaded: 0
Commodities: Total: 0, Loaded: 0
Scheduled Tansactions: Total: 11, Loaded: 10
Budgets: Total: 1, Loaded: 0
Transactions: Total: 535, Loaded: 547
Accounts: Total: 114, Loaded: 113
Books: Total: 1, Loaded: 0
Commodities: Total: 0, Loaded: 0
Scheduled Tansactions: Total: 11, Loaded: 11
Budgets: Total: 1, Loaded: 0

My real question is, do lines like:

Transactions: Total: 535, Loaded: 547
Accounts: Total: 114, Loaded: 113

tell me anything at all (good or bad) about my data file?

If so, would it make sense to print only lines where the numbers are
not equal?

-chris

> 
> David
> 
> 


More information about the gnucash-devel mailing list