SETI / rms-pds4indextools

PDS4 index tools Python module
Apache License 2.0
0 stars 0 forks source link

pds4_create_xml_index does not validate type of label to generate #16

Closed rfrenchseti closed 1 month ago

rfrenchseti commented 2 months ago

pds4_create_xml_index.py:

The --generate-label option takes one of two values: Product_Ancillary or Product_Metadata_Supplemental. However, the program does not check that one of these is provided. For example:

❯ python pds4_create_xml_index.py /mnt/rms-holdings/pds4-holdings/bundles/uranus_occs_earthbased/uranus_occ_u0_kao_91cm "**/data/rings/*0m.xml" --output-headers-file rings_hdr4.txt --simplify-xpaths --output-index-file rings_index6.csv --limit-xpaths elements2.txt --generate-label bogus_label_type
Index file generated at rings_index6.csv
XPath headers file generated at rings_hdr4.txt
bogus_label_type label generated at rings_index6.xml

When a bad label type is provided, the label defaults to Product_Metadata_Supplemental.