Introducing myself

Geert Janssens geert.gnucash at kobaltwit.be
Tue Oct 11 05:21:34 EDT 2016


On Tuesday 11 October 2016 10:33:26 José JORGE wrote:
> hi,
> 
> I am a Gnucash end user for years, and also it's packager for the
> Mageia Linux distro.
> 
> French law now requires to be able to export in a well defined XML
> format following an XSD structure file :
> https://www.legifrance.gouv.fr/affichTexte.do?cidTexte=JORFTEXT0000277
> 88276&dateTexte=&categorieLien=id
> 
> I wonder if it would be easy to add this export to Gnucash, as I can
> see in gnucash-fr ML this is a big problem.
> 
> I could try myself if someone points me where to start, as I am myself
> in the need of this function. My structure could also donate some
> money to gnucash to make this happen.
> 
> Thanks for your attention
> 
> José

Hi José,

First off, thank you for the time you spend on packaging GnuCash for the 
Mageia Linux distro. That work is highly appreciated!

Right now GnuCash doesn't have any xml export functionality so achieving 
this from within gnucash means writing it from scratch. Ideas about 
exports can be taken from the other export functions, which are written 
in C. I couldn't readily determine which data is required in the xml 
from the link you provided, partly because I don't know what all the 
terms mean on that page, and partly because it seems it's only a summary 
of changes. It does look like more data may be required than gnucash 
stores.

One way you may approach this would be to check whether one or more of 
the included reports in gnucash provide the needed information. The 
reports are formatted as xhtml. which at least follows a similar syntax. 
You may be able to make a variation of such report (or combine 
information from several reports) that outputs an xml file instead. It 
would surely require source code changes for the custom report. The 
reports are written in the guile scripting language so some knowledge of 
that language is a must for this approach.

A variation would be to save the report(s) that contain(s) the needed 
data and then write an xslt filter that translates the report(s) into 
the required xml file.

If you can afford to limit your support to linux-like platforms only, 
you could also investigate the python bindings and check if you can 
gather the needed documentation via python code.

Yet another way may be to explore piecash, which is a project that 
allows to extract data from a gnucash data set in sql format. This 
requires your data file to be saved in sqlite format instead of xml.

And the last possibility I can think of would be to write an xslt filter 
that parses the gnucash data file (when saved as xml) directly to gather 
the necessary data and generate the xml file you need.

Most of these variations are suboptimal obviously. It would be great if 
we could have something better integrated.

Regards,

Geert Janssens



More information about the gnucash-devel mailing list