The simplest way to read a VOTable is to use
the generic table reading method described
in Section 3.2, in which you just submit the URL or
filename of a document to a
StarTableFactory
,
and get back a StarTable
object.
If you're after one of several TABLE elements in a document,
you can specify this by giving its number as the URL's
fragment ID (the bit after the '#' sign).
The following code would give you StarTable
s
read from the first and fourth TABLE elements in the file "tabledoc.xml":
StarTableFactory factory = new StarTableFactory(); StarTable tableA = factory.makeStarTable( "tabledoc.xml", "votable" ); StarTable tableB = factory.makeStarTable( "tabledoc.xml#3", "votable" );
All the data and metadata from the TABLE in the
VOTable document are available from the resulting StarTable
object,
as table parameters, ColumnInfo
s
or the data themselves.
If you are just trying to extract the data and metadata from a
single TABLE element somewhere in a VOTable document, this
procedure is probably all you need.
The parameters
of the table which is obtained are taken from PARAM and INFO elements.
PARAMs or INFOs in the TABLE element itself or in its RESOURCE parent
are considererd to apply to the table.
The values of these can be obtained using the
getParameters
method.