ndgReadVotProv

Read the provenance information from a VOTABLE

Description:

This function reads provenance information from a string of XML text read from a VOTABLE, storing it in a memory-resident structure for faster access. A pointer that identifies this structure is returned, and can be passed to other NDG provenance functions to manipulate the contents of the structure.

If the XML text has no provenance information, the returned structure will contain just the supplied creator name (which may be blank), and an empty ancestor list.

The structure should be freed when it is no longer needed by calling ndgFreeProv.

Invocation

NdgProvenance ndgReadVotProv( const char xml, const char path, const char creator, int status )

Arguments

xml
Pointer to a null terminated string holding XML read from a VOTABLE. The provenance information is read from the first element found in the text that has the opening tag:

" <GROUP name="PROVENANCE" utype="hds_type:PROVENANCE" >"

This is the form produced by function ndgWriteVotProv.

path
The path to the file from which the XML provenance text was read.
creator
A text identifier for the software that created the NDF with which the provnance is associated (usually the name of the calling application). The format of the identifier is arbitrary, but the form "PACKAGE:COMMAND" is recommended. This value is only used if the the supplied XML text does not contain any provenance information.
status
The global status.

Returned Value

A pointer that identifies the structure holding the provenance information read from the VOTABLE. Note, this is not a genuine pointer to the structure and should not be de-referenced. A NULL pointer is returned if an error occurs.