21 function toXml($record, $format =
null) {
22 $article =& $record->getData(
'article');
23 $journal =& $record->getData(
'journal');
24 $section =& $record->getData(
'section');
25 $issue =& $record->getData(
'issue');
26 $galleys =& $record->getData(
'galleys');
29 $publisher = $journal->getLocalizedName();
30 $publisherInstitution = $journal->getLocalizedData(
'publisherInstitution');
31 if (!empty($publisherInstitution)) {
32 $publisher = $publisherInstitution;
36 $source = $issue->getIssueIdentification();
37 $pages = $article->getPages();
38 if (!empty($pages)) $source .=
'; ' . $pages;
42 $authors = $article->getAuthors();
43 for ($i = 0, $num = count($authors); $i < $num; $i++) {
44 $authorName = $authors[$i]->getFullName(
false,
true);
45 $affiliation = $authors[$i]->getLocalizedAffiliation();
46 if (!empty($affiliation)) {
47 $authorName .=
'; ' . $affiliation;
49 $creators[] = $authorName;
53 $subjects = array_merge_recursive(
57 $subject = isset($subjects[$journal->getPrimaryLocale()])?$subjects[$journal->getPrimaryLocale()]:
'';
60 $coverage = $article->getCoverage(
null);
62 import(
'classes.issue.IssueAction');
65 $url = $request->url($journal->getPath(),
'article',
'view', array($article->getBestId()));
66 $includeUrls = $journal->getSetting(
'publishingMode') != PUBLISHING_MODE_NONE || $issueAction->subscribedUser($request->getUser(), $journal,
null, $article->getId());
67 $response =
"<rfc1807\n" .
68 "\txmlns=\"http://info.internet.isi.edu:80/in-notes/rfc/files/rfc1807.txt\"\n" .
69 "\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" .
70 "\txsi:schemaLocation=\"http://info.internet.isi.edu:80/in-notes/rfc/files/rfc1807.txt\n" .
71 "\thttp://www.openarchives.org/OAI/1.1/rfc1807.xsd\">\n" .
72 "\t<bib-version>v2</bib-version>\n" .
77 $this->
formatElement(
'title', $article->getLocalizedTitle()) .
78 $this->
formatElement(
'type', $section->getLocalizedIdentifyType()) .
81 ($article->getDatePublished()?$this->
formatElement(
'date', $article->getDatePublished()):
'') .
82 $this->
formatElement(
'copyright', strip_tags($journal->getLocalizedData(
'licenseTerms'))) .
83 ($includeUrls?$this->
formatElement(
'other_access',
"url:$url"):
'') .
86 $this->
formatElement(
'monitoring', $article->getLocalizedSponsor()) .
88 $this->
formatElement(
'abstract', strip_tags($article->getLocalizedAbstract())) .
100 if (!is_array($value)) {
101 $value = array($value);
105 foreach ($value as $v) {