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