Datalink XSL

Markus Demleitner msdemlei at ari.uni-heidelberg.de
Tue Mar 23 09:36:40 CET 2021


Dear DAL community,

Up front: If you don't publish Datalink documents, there's nothing
relevant to you in this mail.

Otherwise, since it's been a while that I've last advertised it and
there have been a few (minor) updates to it, let me give a little
sales pitch for adding stylesheets to Datalink documents.

The background is that that way, they do something sensible in web
browsers, which is still nice even though datalink clients have made
good progress in the past few years; for instance,

http://dc.zah.uni-heidelberg.de/califa/q3/dl/dlmeta?ID=ivo%3A%2F%2Forg.gavo.dc%2F%7E%3Fcalifa%2Fdatadr3%2FCOMB%2FARP220.COMB.rscube.fits

is a simple datalink document, but in the browser, you still get a
halfway sensible display.  Getting this is (conceptually) as simple
as adding something like

  <?xml-stylesheet href='/static/xsl/datalink-to-html.xsl' type='text/xsl'?>

to the top of your datalink document and putting the style sheet up
in your server at the right position (due to cross-site restrictions,
you can't (easily) pull style sheets from somewhere else).

In reality, I'm using a bit of javascript on top for the processing
services (e.g., let people do spatial cutouts with the mouse or
spectral cutouts in their preferred units).

And, yes, the thing could be made a lot prettier.  

You will find the XSL at

http://svn.ari.uni-heidelberg.de/svn/gavo/python/trunk/gavo/resources/web/xsl/datalink-to-html.xsl

and the associated javascript in

http://svn.ari.uni-heidelberg.de/svn/gavo/python/trunk/gavo/resources/web/js

(sodapars.js and footprintedit.js).

If there's interest in (re-) using that, I'd be happy[1] to set up a
little repo on github and put a bit more work into this; I could, for
instance, well imagine to improve the use of the semantics column if
the thing got used outside of DaCHS.

Just drop me a mail if you're interested.

Thanks,

         Markus

[1] minus feeding behavioural surplus to Microsoft, but... ah well.


More information about the dal mailing list