[AstroPy] Empty char value for PARAM with vo.table

Michael Droettboom mdroe at stsci.edu
Mon May 14 10:27:36 EDT 2012


On 05/10/2012 12:59 PM, Rodney Barnett wrote:
> I'm working with some VOTable files that have tags like this:
>
> <PARAM name="XYZ" datatype="char" arraysize="*" ucd="meta.id;meta.file"
> value=""/>
>
> vo.table.parse reports:
>
> vo.voexceptions.E14: file.xml:213:3: E14: value attribute is required
> for all PARAM elements
>
> The spec is clear that the value attribute is required, but isn't clear
> about whether the value must be non-empty.  Is there a consensus on this?
I think you're right -- it should probably be acceptable to have the 
value attribute provided but empty.

It turns out this is trickier than it sounds -- the expat XML parser 
vo.table uses treats an attribute with an empty value as if the 
attribute doesn't appear at all.  So it's impossible to distinguish 
between the two cases.  I've changed this to a missing attribute will be 
treated as an empty string, which is not strictly correct wrt the 
VOTable spec, but it accepts a class of documents (such as yours) that 
is correct.

The fix is in SVN r2748.

Mike



More information about the AstroPy mailing list