Export from GnuCash to Gnumeric

Zach Garner zach@neurosoft.org
05 Mar 2002 18:45:51 -0600


Just a note: 

Doing this in scheme will require a somewhat hard to find SSAX library
(it is available for guile, however). The library does not exist as
official packages for FreeBSD or Debian, and probably does not exist in
other unix and linux systems. SSAX is also not blessed by W3C (which may
not matter to anyone)

Using something like Xalan-C++ may not fit as well into Gnucash than a
guile module, but there is much more support for C/C++ based XSLT
engines.

To do XSLT (i.e. the "conventional" way to translate XML data in one
format to another format) GnuCash will need to use another external
library. It may be possible to do it internally without needing XSLT,
but it seems a bit difficult to me.

Finally, SOMEONE FIX THE XML NAMESPACES! I have to write a stupid sed
script to get XSLT to work. GnuCash uses XML namespaces but does not
declare them. 

Anyways, After the namespace issue is resolved, and after it is decided
whether Scheme SXSLT and SXML is better for the project than regular
XSLT, I'll start working on an exporter.


Zach Garner



On Mon, 2002-03-04 at 15:28, Derek Atkins wrote:
> You might want to write this in Scheme and supply it as a Gnucash
> exporter?
> 
> -derek
> 
> Zach Garner <zach@neurosoft.org> writes:
> 
> > I have spent a couple hours learning some XML and hacked an XSL file to
> > convert from a GnuCash Account file to a Gnumeric spreadsheet. It is
> > very rough at this point. Downloaded it at
> > http://www.neurosoft.org/gnucash/gnumeric_xsl , or get it from the
> > attachment.
> > 
> > 
> > A couple of obvious (and major) problems:
> > 1. Gnucash does not define its Namespaces properly. For XSL to work, you
> > have to edit the Account file, and change <gnc-v2> to:
> >   <gnc-v2 xmlns:act="http://www.gnucash.org/act"
> >         xmlns:gnc="http://www.gnucash.org/gnc"
> >         xmlns:trn="http://www.gnucash.org/trn"
> >         xmlns:ts="http://www.gnucash.org/ts"
> >         xmlns:split="http://www.gnucash.org/split">
> > 
> > These are just bogus values. The Gnucash project needs to properly
> > define the namespaces; this has been mentioned before on this list.
> > 
> > 2. I haven't been able to properly connect the Account Name and the
> > Account ID within the spreadsheet. This causes the transactions to be
> > listed by the ID instead of by the name.
> > 
> > ---
> > 
> > To use with Apache Xalan, execute
> >   $ java org.apache.xalan.xslt.Process -in Accounts.gnucash -xsl
> > gnumeric.xsl -out Accounts.gnumeric
> > 
> > 
> > ---
> > 
> > Suggestions/Criticism/etc welcome. 
> > 
> > I'm doing this for my own benefit, but I would like to know if this
> > would be useful to the project. I'm curious if this might be better
> > implemented as a SXSL (scheme XSL: http://okmij.org/ftp/Scheme/xml.html)
> > 
> > 
> > thanks,
> > Zach Garner
> > 
> > p.s. I sent a similar message little while back, but it apparently
> > didn't make it because the maintainer is behind. (that's OK though!)
> > 
> > 
> 
> -- 
>        Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
>        Member, MIT Student Information Processing Board  (SIPB)
>        URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
>        warlord@MIT.EDU                        PGP key available
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel@lists.gnumatic.com
> http://www.gnumatic.com/cgi-bin/mailman/listinfo/gnucash-devel
>