/** * creates the METS:dmdSec element for a Section */ function generateSectionDmdSecDom(&$doc, &$root, &$section, &$issue, &$journal) { $dmdSec =& XMLCustomWriter::createElement($doc, 'METS:dmdSec'); XMLCustomWriter::setAttribute($dmdSec, 'ID', 'S-' . $section->getId()); $mdWrap =& XMLCustomWriter::createElement($doc, 'METS:mdWrap'); $xmlData =& XMLCustomWriter::createElement($doc, 'METS:xmlData'); XMLCustomWriter::setAttribute($mdWrap, 'MDTYPE', 'MODS'); $mods =& XMLCustomWriter::createElement($doc, 'mods:mods'); XMLCustomWriter::setAttribute($mods, 'xmlns:mods', 'http://www.loc.gov/mods/v3'); XMLCustomWriter::setAttribute($root, 'xsi:schemaLocation', str_replace(' http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-0.xsd', '', $root->getAttribute('xsi:schemaLocation')) . ' http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-0.xsd'); $titleInfo =& XMLCustomWriter::createElement($doc, 'mods:titleInfo'); XMLCustomWriter::createChildWithText($doc, $titleInfo, 'mods:title', $section->getLocalizedTitle()); XMLCustomWriter::appendChild($mods, $titleInfo); if ($section->getLocalizedAbbrev() != '') { $titleInfoAlt =& XMLCustomWriter::createElement($doc, 'mods:titleInfo'); XMLCustomWriter::createChildWithText($doc, $titleInfoAlt, 'mods:title', $section->getLocalizedAbbrev()); XMLCustomWriter::setAttribute($titleInfoAlt, 'type', 'abbreviated'); XMLCustomWriter::appendChild($mods, $titleInfoAlt); } XMLCustomWriter::createChildWithText($doc, $mods, 'mods:genre', 'section'); XMLCustomWriter::appendChild($xmlData, $mods); XMLCustomWriter::appendChild($dmdSec, $mdWrap); XMLCustomWriter::appendChild($mdWrap, $xmlData); XMLCustomWriter::appendChild($root, $dmdSec); $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO'); $publishedArticleArray =& $publishedArticleDao->getPublishedArticlesBySectionId($section->getId(), $issue->getId()); $i = 0; $i = 0; while ($i < sizeof($publishedArticleArray)) { MetsExportDom::generateArticleDmdSecDom($doc, $root, $publishedArticleArray[$i], $issue, $journal); $i++; } }