#15 SGML Parse Error on Date Format

open
nobody
5
2012-11-26
2006-03-19
No

The OFX files exported by the Standard Bank of South
Africa have a date format which causes the SGML parser
to abort. This affects the following tokens

<DTSTART>2006/02/27
<DTEND>2006/03/20
<DTPOSTED>2006/02/27
<DTASOF>2006/03/20

If the file is edited to remove the slashes from these
fields, the parser accepts them and processes the file
happily.

Note: there appears to be some variability, since I
have seen the following formats for downloads over the
past month:
<DTASOF>20060102
<DTASOF>2006-03-03
<DTASOF>24/02/2006
<DTASOF>2006/02/27

Discussion

  • ace jones

    ace jones - 2006-08-02

    Logged In: YES
    user_id=954547

    You could point out to the bank that their files fail to
    follow the OFX spec (see sec 3.2.8.1 that describes how
    datetime values are to be stored). Among your examples,
    ONLY "<DTASOF>20060102" are correct.

    That having been said, it would probably be handy to have
    libofx rip out the punctuation characters.

     
  • Alan Zimmerman

    Alan Zimmerman - 2006-08-02

    Logged In: YES
    user_id=7036

    I have corresponded with the bank about it, and got a polite
    response saying it would be forwarded to their technical
    department. I have since heard nothing, and the behaviour
    has not changed.

    I have been manually editing the downloaded files to remove
    the additional punctuation (but only for the tags listed,
    the other identifiers based on dates in the same format seem
    to be ok), and it then imports without a problem.

     
  • Nobody/Anonymous

    Gnucash is getting several several reports lately about this issue. See the collecting bug:
    https://bugzilla.gnome.org/show_bug.cgi?id=571447

    The date formats reported are:
    02/23/2008
    05-03-2010

    Which are both still different from what Alan already found.

    In GnuCash, these invalid dates cause libofx to crash. I'm not sure if this is what Alan meant with "abort", so I mention this explicitly.

    I would be good if libofx at lease failed more gracefully on an invalid date format. It would even be better, if it attempted to interpret the date and if successful, simply continue, optionally issuing a warning.

     

Log in to post a comment.