Whitespace handling in VOTable field description

Dempsey, James (IM&T, Black Mountain) James.Dempsey at csiro.au
Fri Feb 12 00:24:21 CET 2021


Hi Mark and Pierre,

Thanks for the clarification. I was only checking the XSD, which is a bit different.

The problem for me is that I specify in astropy a description "some long text" and when I view the votable in topcat it comes out as "    some long     text". Its not a big thing, it just looks untidy.

Cheers,
James Dempsey
Senior Developer  |  CSIRO 
james.dempsey at csiro.au  |  02 6214 2912

-----Original Message-----
From: Mark Taylor <m.b.taylor at bristol.ac.uk> 
Sent: Wednesday, February 3, 2021 11:13 PM
To: Dempsey, James (IM&T, Black Mountain) <James.Dempsey at csiro.au>
Cc: Applications WG <apps at ivoa.net>
Subject: Re: Whitespace handling in VOTable field description

Hi James,

I would personally be reluctant to introduce this change to the standard unless it's causing major problems, since it might affect the behaviour of some existing software in unanticipated ways.

As you observe, STIL doesn't take active steps to collapse whitespace during handling.  But TOPCAT itself doesn't rely too heavily on the whitespace details either, e.g. column and parameter descriptions usually end up displayed on a single line.
So making a change like this probably wouldn't break TOPCAT behaviour in practice.

The VOTable standard doesn't actually say what a client is supposed to do with whitespace in DESCRIPTION text; I wouldn't say that collapsing it for display or reformatting it for output is necessarily a bug.
Note the lack of discussion on this topic dates from VOTable 1.0 which was defined by a DTD not an XSD; I believe(?) that pre-XSD there was no way to declare that whitespace within an element should be collapsed.

What exactly is the behaviour of astropy which you think contravenes the standard?  Is it actually a bug or just a questionable formatting decision?

Mark

On Wed, 3 Feb 2021, Dempsey, James (IM&T, Black Mountain) wrote:

> Hi Apps,
> 
> I've noticed that topcat and astropy do not agree on how to handle 
> whitespace in a VOTable field description. TOPCAT seems to be correct 
> in that it preserves whitespace, but astropy is outputting a field 
> description as
> 
>     <DESCRIPTION>
>      1-sigma noise level of the spectrum in opacity units. Does not
>      include emission noise.
>     </DESCRIPTION>
> 
> which is expecting the whitespace to be collapsed (i.e. <xs:whiteSpace value="collapse"/>). Being too used to html I was surprised that the default whitespace rule for XML is 'preserve'.
> 
> So, what do people think about changing the VOTable XML schema (and spec) to say the whitespace should be collapsed? If that isn't popular, I'll raise a bug with astropy.
> 
> Cheers,
> James Dempsey
> Senior Developer
> Information Services Applications
> CSIRO Information Management & Technology (IM&T)
> 

--
Mark Taylor  Astronomical Programmer  Physics, Bristol University, UK
m.b.taylor at bristol.ac.uk          http://www.star.bristol.ac.uk/~mbt/


More information about the apps mailing list