Whitespace handling in VOTable field description

Mark Taylor m.b.taylor at bristol.ac.uk
Mon Mar 8 18:19:44 CET 2021


James,

I've made a change to TOPCAT (and STILTS) so that for the purposes
of one-line display, it does collapse the whitespace (in the XSD sense)
of content that may have been acquired from a VOTable DESCRIPTION
element.  So you should see "some long text" in e.g. TOPCAT's
column info window or STILTS's metadata output modes in future releases.
They still keep track of the original whitespace internally, so
for instance if the text is written back to DESCRIPTION elements
on output, any whitespace formatting doesn't get lost.

This is more sensible than the previous behaviour ("    some long     text"
appearing in a JTable cell wasn't doing anybody any good),
 so thanks for raising this.

The pre-release with changed behaviour is at

   ftp://andromeda.star.bris.ac.uk/pub/star/topcat/pre/topcat-full.jar

in case you want to try it.

Mark


On Thu, 11 Feb 2021, Dempsey, James (IM&T, Black Mountain) wrote:

> 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/
> 

--
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