Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Unable to parse Google Finance ("Investment" type) OFX #15

@ArakTaiRoth

Description

@ArakTaiRoth

Hey there, I've just tried parsing an OFX file from a dummy account on Google Finance and I get the following really long error:

Failed to parse OFX: array ( 0 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 76, 'column' => 11, 'message' => 'Opening and ending tag mismatch: MEMO line 67 and INVTRAN ', 'file' => '', 'line' => 69, )), 1 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 76, 'column' => 13, 'message' => 'Opening and ending tag mismatch: INVTRAN line 61 and INVBUY ', 'file' => '', 'line' => 89, )), 2 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 76, 'column' => 12, 'message' => 'Opening and ending tag mismatch: INVBUY line 59 and BUYSTOCK ', 'file' => '', 'line' => 93, )), 3 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 76, 'column' => 11, 'message' => 'Opening and ending tag mismatch: MEMO line 105 and INVTRAN ', 'file' => '', 'line' => 107, )), 4 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 76, 'column' => 13, 'message' => 'Opening and ending tag mismatch: INVTRAN line 99 and INVBUY ', 'file' => '', 'line' => 127, )), 5 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 76, 'column' => 12, 'message' => 'Opening and ending tag mismatch: INVBUY line 97 and BUYSTOCK ', 'file' => '', 'line' => 131, )), 6 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 76, 'column' => 11, 'message' => 'Opening and ending tag mismatch: MEMO line 143 and INVTRAN ', 'file' => '', 'line' => 145, )), 7 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 76, 'column' => 14, 'message' => 'Opening and ending tag mismatch: INVTRAN line 137 and INVSELL ', 'file' => '', 'line' => 165, )), 8 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 76, 'column' => 13, 'message' => 'Opening and ending tag mismatch: INVSELL line 135 and SELLSTOCK ', 'file' => '', 'line' => 169, )), 9 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 76, 'column' => 15, 'message' => 'Opening and ending tag mismatch: SELLSTOCK line 133 and INVTRANLIST ', 'file' => '', 'line' => 171, )), 10 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 76, 'column' => 13, 'message' => 'Opening and ending tag mismatch: BUYSTOCK line 95 and INVSTMTRS ', 'file' => '', 'line' => 173, )), 11 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 76, 'column' => 16, 'message' => 'Opening and ending tag mismatch: BUYSTOCK line 57 and INVSTMTTRNRS ', 'file' => '', 'line' => 175, )), 12 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 76, 'column' => 22, 'message' => 'Opening and ending tag mismatch: INVTRANLIST line 51 and INVSTMTMSGSRSV1 ', 'file' => '', 'line' => 177, )), 13 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 76, 'column' => 7, 'message' => 'Opening and ending tag mismatch: INVSTMTRS line 37 and OFX ', 'file' => '', 'line' => 207, )), 14 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 77, 'column' => 7, 'message' => 'Premature end of data in tag INVSTMTTRNRS line 25 ', 'file' => '', 'line' => 207, )), 15 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 77, 'column' => 7, 'message' => 'Premature end of data in tag INVSTMTMSGSRSV1 line 23 ', 'file' => '', 'line' => 207, )), 16 => LibXMLError::__set_state(array( 'level' => 3, 'code' => 77, 'column' => 7, 'message' => 'Premature end of data in tag OFX line 1 ', 'file' => '', 'line' => 207, )), )

This is with the following data:

OFXHEADER:100
DATA:OFXSGML
VERSION:102
SECURITY:NONE
ENCODING:USASCII
CHARSET:1252
COMPRESSION:NONE
OLDFILEUID:NONE
NEWFILEUID:NONE

<OFX>
<SIGNONMSGSRSV1>
<SONRS>
<STATUS>
<CODE>0
<SEVERITY>INFO
</STATUS>
<DTSERVER>20151130171040.594
<LANGUAGE>ENG
</SONRS>
</SIGNONMSGSRSV1>
<INVSTMTMSGSRSV1>
<INVSTMTTRNRS>
<TRNUID>1001
<STATUS>
<CODE>0
<SEVERITY>INFO
</STATUS>
<INVSTMTRS>
<DTASOF>20151130171040.594
<CURDEF>USD
<INVACCTFROM>
<BROKERID>google.com
<ACCTID>StockersTest
</INVACCTFROM>
<INVTRANLIST>
<DTSTART>20100401000000.000
<DTEND>20150401000000.000
<BUYSTOCK>
<INVBUY>
<INVTRAN>
<FITID>1
<DTTRADE>20100401000000.000
<MEMO>
</INVTRAN>
<SECID>
<UNIQUEID>TSE:T
<UNIQUEIDTYPE>TICKER
</SECID>
<UNITS>5
<UNITPRICE>20
<TOTAL>-100
<SUBACCTSEC>CASH
<SUBACCTFUND>CASH
</INVBUY>
<BUYTYPE>BUY
</BUYSTOCK>
<BUYSTOCK>
<INVBUY>
<INVTRAN>
<FITID>3
<DTTRADE>20150101000000.000
<MEMO>
</INVTRAN>
<SECID>
<UNIQUEID>TSE:T
<UNIQUEIDTYPE>TICKER
</SECID>
<UNITS>20
<UNITPRICE>35
<TOTAL>-700
<SUBACCTSEC>CASH
<SUBACCTFUND>CASH
</INVBUY>
<BUYTYPE>BUY
</BUYSTOCK>
<SELLSTOCK>
<INVSELL>
<INVTRAN>
<FITID>2
<DTTRADE>20150401000000.000
<MEMO>
</INVTRAN>
<SECID>
<UNIQUEID>TSE:T
<UNIQUEIDTYPE>TICKER
</SECID>
<UNITS>-20
<UNITPRICE>42.06
<TOTAL>841.2
<SUBACCTSEC>CASH
<SUBACCTFUND>CASH
</INVSELL>
<SELLTYPE>SELL
</SELLSTOCK>
</INVTRANLIST>
</INVSTMTRS>
</INVSTMTTRNRS>
</INVSTMTMSGSRSV1>
<SECLISTMSGSRSV1>
<SECLIST>
<STOCKINFO>
<SECINFO>
<SECID>
<UNIQUEID>TSE:T
<UNIQUEIDTYPE>TICKER
</SECID>
<SECNAME>TELUS Corporation
<TICKER>T
</SECINFO>
</STOCKINFO>
</SECLIST>
</SECLISTMSGSRSV1>
</OFX>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis is a bug report issue or PR that fixes a bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions