XML preamble in CSV export

Anton Lundin glance at acc.umu.se
Tue Jul 15 06:45:20 PDT 2014


On 15 July, 2014 - Miika Turkia wrote:

> On Tue, Jul 15, 2014 at 4:00 PM, Sergey Starosek <sergey.starosek at gmail.com>
> wrote:
> 
> > Miika,
> >
> > Is it OK that exported CSV file contains XML preamble along with header?
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> >> "dive number","date","time","duration","depth","temperature","pressure"
> >> "83","2014-07-13","13:35:00","0:00","0.0",,
> >
> >
> I would prefer the export without the XML preamble. I suppose the preamble
> is added by Subsurface (C side) when saving the file. If you have an idea
> how to get rid of it, go for it.
> 

The reson why the xml header is there in the csv export is that the csv
export is done via a xslt style sheet, the same path as the uddf export
is done.


The way to solve this would be to separate the transformation from the
writing to file and ex. return a membuffer from export_dives_xslt, let
the calling function who knows that its actually csv strip the xml
header and call a membuffer to file dumper.


xmlDocDumpMemory looks like a good candidate to write to a membuffer.


//Anton - Who partly brain dumps so me or someone else can pick this up


-- 
Anton Lundin	+46702-161604


More information about the subsurface mailing list