Double records
Paul Sephton <[email protected]> Thu, 05 Oct 2006 15:31:27 +0200
| Newsgroups | gmane.comp.finance.libofx.devel |
|---|---|
| Organization | I-Net Bridge |
| Message-ID | <[email protected]> |
Hi;
This might not be the right approach to fixing the problem, but here
goes:
Using libofx v0.8.2 together with OpenSP-1.5.2, I found that ofxdump
against an OFC file produced a number of blank records; in particular,
the GENTRN and ACCOUNT fields seem to be automatically generated by
opensp whenever the parser encounters the ACCTFROM or STMTTRN tags.This
leads, for example, to two account records (one blank and the other
complete) being created and added to the main record where in reality
only one account is evident. The first is generated on interpreting the
opensp-generated </ACCOUNT> tag, and the other (the blank one) when
interpreting the </ACCTFROM> closing tag. The same sort f thing happens
with STMTTRN tags.
A quick workaround (who knows what this might break) is as follows:
void endElement (const EndElementEvent & event)
{
string identifier;
bool end_element_for_data_element;
....
if(MainContainer != NULL)
{
if (identifier == "STMTTRN")
{ // GENTRN is generated by OpenS
message_out (PARSER, "Element " + identifier + " closed,
object not added");
}
else if (identifier == "ACCTFROM")
{ // ACCOUNT generated by OpenSP
message_out (PARSER, "Element " + identifier + " closed,
object not added");
}
else
{
tmp_container_element->add_to_main_tree();
message_out (PARSER, "Element " + identifier + " closed,
object added to MainContainer");
}
}
else
....
This quite simply assumes that opensp will always generate ACCOUNT and
GENTRN instructions, and therefore that these would result in the
appropriate records being added, and so it is unnecessary to add
ofx_container_account or ofx_container_transaction when processing
ACCTFROM or STMTTRN identifiers.
Seems to work, but the knowledgable guys can take it from here...
Paul
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Libofx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libofx-devel