From: Benoit G. <be...@co...> - 2012-01-21 19:47:14
|
On January 19, 2012 03:00:48 PM Martin Javorek wrote: > Hi all, > > I'm playing a little bit with KMyMoney software which is using libofx > library for parsing OFX files. There is a problem regarding parsing OFX > version 2 file and KMyMoney developers send me to this forum. > > Original post: > https://mail.kde.org/pipermail/kmymoney-devel/2012-January/007513.html > Whole thread: > https://mail.kde.org/pipermail/kmymoney-devel/2012-January/thread.html#7513 > (not too long) > > The problem is with character encoding. Even the OFX version 2 (XML file) > has proper headers set to UTF-8, KMyMoney imports it in UTF-8 only if the > file has textual headers before <?xml> tag similar to OFX version 1. That's strange, but I don't know if Kmymoney does any preprocessiong of the file before passing it to libofx. But normally OFX2 files are pure XML. There were some encoding workarounds in the recently released libofx 0.9.5, but I do not believe any of them apply to your situation. > I'm not a OFX guru, I have read the spec only for a while, but I cannot > imagine, how to work with XML file, which has those special headers. How to > validate that file against XSD or anything else. It looks for me a little > bit strange. Many things in OFX are a little bit strange ;). In any event, for OFX 1 files are SGML, not XML, and need to be split (header and content) before validation. Libofx handles this internally. -- Benoit Grégoire, ing., PMP, PSM |