Commit ff8c764d35834bf51a4e8b458da7d6090165345f

Authored by Benjamin Renard
1 parent f5df7de1

Add datasetGroup support for HAPI + decode html entities for units

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
update_amda/makeHAPIMetadata.php
... ... @@ -12,7 +12,7 @@ $doc = new DOMDocument();
12 12  
13 13 $xpath = new DOMXpath($doc);
14 14  
15   -$dataset_nodes = $xpath->query("/dataRoot/dataCenter/mission/instrument/dataset | /dataRoot/dataCenter/mission/observatory/instrument/dataset");
  15 +$dataset_nodes = $xpath->query("/dataRoot/dataCenter/mission/instrument/dataset | /dataRoot/dataCenter/mission/observatory/instrument/dataset | /dataRoot/dataCenter/mission/instrument/datasetGroup/dataset");
16 16 $datasets = array();
17 17 foreach ($dataset_nodes as $dataset_node) {
18 18 $datasetId = $dataset_node->getAttribute("xml:id");
... ... @@ -175,7 +175,7 @@ foreach ($dataset_nodes as $dataset_node) {
175 175 if (!empty($ranges)) {
176 176 $bin_info = (Object)array();
177 177 $bin_info->{"name"} = $nameBin;
178   - $bin_info->{"units"} = $unitsBin;
  178 + $bin_info->{"units"} = html_entity_decode($unitsBin);
179 179 $bin_info->{"ranges"} = $ranges;
180 180 if ($bin_index == 0) {
181 181 array_unshift($bins, $bin_info);
... ... @@ -196,7 +196,7 @@ foreach ($dataset_nodes as $dataset_node) {
196 196 $units = $parameter_node->getAttribute("units");
197 197 if (empty($units))
198 198 $units = NULL;
199   - $parameter->{"units"} = $units;
  199 + $parameter->{"units"} = html_entity_decode($units);
200 200  
201 201 //fill
202 202 $parameter->{"fill"} = "-1e31";
... ...