error parsing

Geert Janssens janssens-geert at telenet.be
Sun Mar 4 15:16:09 EST 2012


Op zondag 4 maart 2012 14:38:13 schreef Vaughn Family Farm, Bryant:
> As I have now tried to manually edit the many, many, many transactions, with
> the same error parsing error.  Here are the instructions I am following:
> 
> Q: When I try to open my datafile on Windows, I get "Parse error". What
> happened ?
> A: There is a peculiarity in GnuCash on Windows when you use the Opening
> balance tab of the account dialog. If you enter a two-digit year in that
> tab, the date is not saved properly. Subsequently, when you reopen your
> datafile afterwards, GnuCash thinks it's invalid. If you encounter such a
> situation, you can attempt to fix your data file manually.
> Make a copy of your data file and uncompress it (with a tool like 7Zip).
> Open the uncompressed file with a text editor such as Wordpad or Notepad++.
> This is an xml file. xml looks a bit like html, but uses different tag
> names.
> Look for transaction sections that are missing a <trn:date-posted section>.
> If you find such transactions, add the <trn:date-posted> section below the
> <trn:currency> section, like so:
>  <trn:currency>
>  ...
>  </trn:currency>
>  <trn:date-posted>
>  <ts:date>2011-07-06 00:00:00 -0400</ts:date>
>  </trn:date-posted>
> Obviously, you can enter the date that suits you, but keep the format as
> shown.
> When all transactions have a <trn.date-posted> section, save your file.
> It should now open with GnuCash again
> You could run into the same problem when you enter opening balances via the
> New Account Hierarchy Assistant. The solution is the same: you will have to
> add the missing <trn:date-posted> sections.
> Note: This problem occurs in all versions of GnuCash 2.4.x and older. It
> will be fixed in version 2.6.x when it is released.
> 
> _____
> 
> Should I be searching for every occurrence of <trn:currency> (without the
> slash mark between the "<" symbol and the "t") - these seem to be the ones
> which are not followed by a <trn:date-posted>... ?  and then replace it or
> add after it?  In other words do I leave the "<trn:currency> or replace it
> with </trn:currency> as it seems to say above.  I have already tried to
> replacing it but I get the same parsing error after I try to open the file,
> with all of the accounts given a zero balance.
> 
> Thanks,
> Bryant
> 
> 
You should add after it, not replace it. If you replace it, your file will 
again be unparseable, but for another reason (missing trn:currency sections).

You should only add the trn:date-posted lines after the trn:currency sections 
if they are missing.

For clarity: the <trn:currency> (without slash) and </trn:currency> (with 
slash) mark the beginning and end of your transaction's currency definition. 
It should be present in each transaction. The dots in the example suggest 
there is some more information between the two markers, which you should leave 
unchanged.

The <trn:date-posted> and </trn:date-posted> mark the beginning and end of a 
block defining the date at which your transaction was posted. This block 
should be added right after the currency block (so right after 
</trn:currency>, the one with slash).

Geert


More information about the gnucash-user mailing list