multiple accounts ofx combined
jettero opened this issue · 2 comments
The output of ofxclient in combined mode (with the --download of all accounts) produces an OFX file that I suspect isn't standard in any way. It seems the ofxmain.dtd allows it, but it's hard to say, since no OFX file seems to be XML validatable (imo) and xml-valid inputs (not counting the ofx file header) don't work with several of my banks.
Anyway, the output of ofxclient combined is something like this:
<OFX>
<SIGNONMSGSRSV1>
… <FI><FID>1</FID>…</FI>
</SIGNONMSGSRSV1>
<CREDITCARDMSGSRSV1>
… blah, statement stuff here, blah
</CREDITCARDMSGSRSV1>
<SIGNONMSGSRSV1>
… <FI><FID>2</FID></FI>
</SIGNONMSGSRSV1>
<BANKMSGSRSV1>
… blah, statement stuff here, blah
</BANKMSGSRSV1>
</OFX>
ofxparse is parsing this mess OK, but all accounts in ofx.accounts
have the very last last FI/FID value found in the file. That is, the creditcard statement stuff will have ofx.accounts[0].institution.fid == 2
and the bank ofx.accounts[1].institution.fid == 2
as well.
Is this something I need to repair before using ofxparse on the file? or is this something ofxparse could do better?
Thanks.
That's a good idea. I think I'll do that.
And just so this is all in once place, I'm pasting the DTD below. I'm pretty sure this says you can have equally many of each type of MSGSRS in the OFX as you like. Personally, I hate when xml has order dependent things in it, but I've seen APIs like that before... I think this really might be one.
<!ENTITY % OFXRQMSGSETS
"SIGNONMSGSRQV1,
SIGNUPMSGSRQV1?,
BANKMSGSRQV1?,
CREDITCARDMSGSRQV1?,
INVSTMTMSGSRQV1?,
INTERXFERMSGSRQV1?,
WIREXFERMSGSRQV1?,
BILLPAYMSGSRQV1?,
EMAILMSGSRQV1?,
SECLISTMSGSRQV1?,
PROFMSGSRQV1?
%EXTRARQMSGSETS">
<!ENTITY % OFXRSMSGSETS
"SIGNONMSGSRSV1,
SIGNUPMSGSRSV1?,
BANKMSGSRSV1?,
CREDITCARDMSGSRSV1?,
INVSTMTMSGSRSV1?,
INTERXFERMSGSRSV1?,
WIREXFERMSGSRSV1?,
BILLPAYMSGSRSV1?,
EMAILMSGSRSV1?,
SECLISTMSGSRSV1?,
PROFMSGSRSV1?
%EXTRARSMSGSETS">
<!ELEMENT OFX - - ((%OFXRQMSGSETS) | (%OFXRSMSGSETS))>