Whitespace handling in VOTable field description

Mark Taylor m.b.taylor at bristol.ac.uk
Wed Feb 3 13:12:34 CET 2021


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