getElementsByTagName('record');
foreach ($Units as $Unit) {
$UnitID = $Unit->getElementsByTagName('CatalogNumberText');
if(empty($UnitID->item(0)->nodeValue)) { $UnitID = $Unit->getElementsByTagName('CatalogNumber'); }
$SourceInstitutionCode = $Unit->getElementsByTagName('InstitutionCode');
$SourceName = $Unit->getElementsByTagName('CollectionCode');
// echo "Unit ID: " . $UnitID->item(0)->nodeValue . "
";
// echo "Source Institution: " . $SourceInstitutionCode->item(0)->nodeValue . "
";
// echo "Source Collection: " . $SourceName->item(0)->nodeValue . "
";
$sqlUnitID = addslashes(utf8_decode($UnitID->item(0)->nodeValue));
$sqlSourceInstitutionCode = addslashes(utf8_decode($SourceInstitutionCode->item(0)->nodeValue));
$sqlSourceName = addslashes(utf8_decode($SourceName->item(0)->nodeValue));
/*----------------------------GATHERING--------------------------------------------------------- */
$GatheringYear = $Unit->getElementsByTagName('YearCollected');
$GatheringMonth = $Unit->getElementsByTagName('MonthCollected');
$GatheringDay = $Unit->getElementsByTagName('DayCollected');
$GatheringAgents = $Unit->getElementsByTagName('Collector');
$ContinentOrOcean = $Unit->getElementsByTagName('ContinentOcean');
$LocalityText = $Unit->getElementsByTagName('Locality');
$Country = $Unit->getElementsByTagName('Country');
$StateProvince = $Unit->getElementsByTagName('StateProvince');
$County = $Unit->getElementsByTagName('County');
$LongitudeDecimal = $Unit->getElementsByTagName('Longitude');
$LatitudeDecimal = $Unit->getElementsByTagName('Latitude');
$Altitude = $Unit->getElementsByTagName('Altitude');
/* echo "Date: " . $GatheringDay->item(0)->nodeValue . ".";
echo $GatheringMonth->item(0)->nodeValue . ".";
echo $GatheringYear->item(0)->nodeValue . "
";
echo "Person: " . $GatheringAgents->item(0)->nodeValue . "
";
echo "Locality: " . $StateProvince->item(0)->nodeValue . " ";
echo $County->item(0)->nodeValue . " ";
echo $LocalityText->item(0)->nodeValue . "
";
echo "Country: " . $Country->item(0)->nodeValue . "
";
echo "Continent or Ocean: " . $ContinentOrOcean->item(0)->nodeValue . "
";
echo "Longitude: " . $LongitudeDecimal->item(0)->nodeValue . "
";
echo "Latitude: " . $LatitudeDecimal->item(0)->nodeValue . "
";
echo "Altitude: " . $Altitude->item(0)->nodeValue . "
";*/
$sqlGatheringDate = $GatheringDay->item(0)->nodeValue;
if ($GatheringDay) {
$sqlGatheringDate .= "."; }
$sqlGatheringDate .= $GatheringMonth->item(0)->nodeValue;
if ($GatheringMonth) {
$sqlGatheringDate .= "."; }
$sqlGatheringDate .= $GatheringYear->item(0)->nodeValue;
$sqlPersonName = addslashes($GatheringAgents->item(0)->nodeValue);
$sqlLocalityText = addslashes(utf8_decode($StateProvince->item(0)->nodeValue));
if ($StateProvince) {
$sqlLocalityText .= " "; }
$sqlLocalityText .= addslashes(utf8_decode($County->item(0)->nodeValue));
if ($County) {
$sqlLocalityText .= " "; }
$sqlLocalityText .= addslashes(utf8_decode($LocalityText->item(0)->nodeValue));
$sqlLongitudeDecimal = $LongitudeDecimal->item(0)->nodeValue;
$sqlLatitudeDecimal = $LatitudeDecimal->item(0)->nodeValue;
$sqlAltitude = addslashes($Altitude->item(0)->nodeValue);
$sqlContinentOrOcean = addslashes($ContinentOrOcean->item(0)->nodeValue);
$sqlCountryName = addslashes($Country->item(0)->nodeValue);
/*----------------------------IDENTIFICATIONS--------------------------------------------------------- */
$NameAuthorYearString = $Unit->getElementsByTagName('ScientificName'); // Name, Author, Year
$Kingdom = $Unit->getElementsByTagName('Kingdom');
$Phylum = $Unit->getElementsByTagName('Phylum');
$Class = $Unit->getElementsByTagName('Class');
$Order = $Unit->getElementsByTagName('Order');
$Family = $Unit->getElementsByTagName('Family');
$HigherTaxon = array ($Kingdom->item(0)->nodeValue, $Phylum->item(0)->nodeValue, $Class->item(0)->nodeValue, $Order->item(0)->nodeValue, $Family->item(0)->nodeValue);
$HigherTaxonRank = array ("Kingdom", "Phylum", "Class", "Order", "Family");
$sqlHigherTaxon = array ($Kingdom->item(0)->nodeValue, $Phylum->item(0)->nodeValue, $Class->item(0)->nodeValue, $Order->item(0)->nodeValue, $Family->item(0)->nodeValue);
if($sqlHigherTaxon[0]) {
$sqlHigherTaxonRank[0] = $HigherTaxonRank[0]; }
if($sqlHigherTaxon[1]) {
$sqlHigherTaxonRank[1] = $HigherTaxonRank[1]; }
if($sqlHigherTaxon[2]) {
$sqlHigherTaxonRank[2] = $HigherTaxonRank[2]; }
if($sqlHigherTaxon[3]) {
$sqlHigherTaxonRank[3] = $HigherTaxonRank[3]; }
if($sqlHigherTaxon[4]) {
$sqlHigherTaxonRank[4] = $HigherTaxonRank[4]; }
$Genus = $Unit->getElementsByTagName('Genus');
$Subgenus = $Unit->getElementsByTagName('Subgenus');
$SpeciesEpithet = $Unit->getElementsByTagName('Species');
$SubspeciesEpithet = $Unit->getElementsByTagName('Subspecies');
$Rank = $Unit->getElementsByTagName('InfraspecificRank');
// echo "Genus: " . $Genus->item(0)->nodeValue . "
";
$sqlGenus = $Genus->item(0)->nodeValue;
// echo "Subgenus: " . $Subgenus->item(0)->nodeValue . "
";
$sqlSubgenus = $Subgenus->item(0)->nodeValue;
// echo "Spec.Epi: " . $SpeciesEpithet->item(0)->nodeValue . "
";
$sqlFirstEpithet = $SpeciesEpithet->item(0)->nodeValue;
// echo "Rank: " . $Rank->item(0)->nodeValue . "
";
$sqlRank = $Rank->item(0)->nodeValue;
// echo "SspEpi: " . $SubspeciesEpithet->item(0)->nodeValue . "
";
$sqlSecondEpithet = $SubspeciesEpithet->item(0)->nodeValue;
// echo "Name All: " . $NameAuthorYearString->item(0)->nodeValue . "
";
$sqlNameAuthorYearString = addslashes(utf8_decode($NameAuthorYearString->item(0)->nodeValue));
/*----------------------------------------MULTI MEDIA OBJECTS -----------------------------*/
$MultiMediaObjects = $Unit->getElementsByTagName('ImageURL');
$sqlFileURI = $MultiMediaObjects->item(0)->nodeValue;
// $TypeStatus = $TypeDesignation->getElementsByTagName('TypeStatus');
// $sqlTypeStatus = $TypeStatus->item(0)->nodeValue;
}
?>