From JDiveLog to Subsurface

Lubomir I. Ivanov neolit123 at gmail.com
Sun Nov 6 16:15:01 EST 2011


oops, resend to mailing list as well...

----- Original Message ----- 
From: "Miika Turkia" <miika.turkia at gmail.com>

> It just occurred to me that the data you show on this test can also be
> parsed by the native parser as these exact node names are close enough to
> other supported formats. So to make sure, could you test with the following
> data:
> http://lists.hohndel.org/pipermail/subsurface/attachments/20111030/f8ba2e11/attachment.bin

yep, works fine with this file as well.
previously i checked if the xslt file is used where the root xml tag was
<JDiveLog>.

> You have a good point there. I think we'll have to add home dir related XSLT
> directory to Linus' XSLT search path. > Is the correct one on windows
> something like "%USERPROFILE%\Application Data\subsurface"?

i think "%USERPROFILE%/.subsurface" is just fine. a lot of applications install
directly in there on win32 ->  /.gimp ; /.mutt; /.ssh....etc

this is what i propose for using the xslt files and the default browse dir on
"file -> open", instead of passing the location to xlst from the macro (getenv()
is part of the standard library and is multiplatform):
------------------------
 char xslt_path[512];
 char *path_ptr = xslt_path;

 #ifdef WIN32
 path_ptr = getenv("USERPROFILE");
 #else /* unix - like */
 path_ptr = getenv("HOME");
 #endif

 if (path_ptr != NULL) {
  printf("user home: %s\n", path_ptr);
  strcat(path_ptr, (const char *)"/.subsurface/xslt/");
  printf("subsurface's XSLT path: %s\n", path_ptr);
 }
----------------------
if the subsurface files aren't in "home" it could check in ./xslt and ./dives
(relative to the binary - e.g. for development), which will also work on all OS.

lubomir



More information about the subsurface mailing list