19 declare(strict_types=1);
36 $xml = new \DomDocument(
'1.0',
'UTF-8');
37 $element = $xml->createElement(
41 $element->setAttribute(
'code', $error->value);
42 $xml->appendChild($element);
47 string $repository_name,
50 string $first_admin_email,
51 string ...$further_admin_emails
67 $this->getFormattedDate($earliest_datestamp)
78 array_unshift($further_admin_emails, $first_admin_email);
79 foreach ($further_admin_emails as $admin_email) {
91 $xml = new \DomDocument(
'1.0',
'UTF-8');
92 $element_xml = $xml->createElement(
96 $xml->appendChild($element_xml);
102 $xml = new \DomDocument(
'1.0',
'UTF-8');
104 $root = $xml->createElement(
'metadataFormat');
105 $xml->appendChild($root);
107 $prefix = $xml->createElement(
111 $root->appendChild($prefix);
113 $schema = $xml->createElement(
115 'http://www.openarchives.org/OAI/2.0/oai_dc.xsd' 117 $root->appendChild($schema);
121 'http://www.openarchives.org/OAI/2.0/oai_dc/' 132 $xml = new \DomDocument(
'1.0',
'UTF-8');
134 $root = $xml->createElement(
'header');
135 $xml->appendChild($root);
137 $identifier = $xml->createElement(
141 $root->appendChild($identifier);
143 $datestamp = $xml->createElement(
145 $this->getFormattedDate($datestamp)
147 $root->appendChild($datestamp);
157 $xml = new \DomDocument(
'1.0',
'UTF-8');
159 $root = $xml->createElement(
'record');
160 $xml->appendChild($root);
163 $root->appendChild($xml->importNode($header_xml->documentElement,
true));
165 $metadata_xml = $xml->createElement(
'metadata');
166 $root->appendChild($metadata_xml);
167 $metadata_xml->appendChild($xml->importNode($metadata->documentElement,
true));
176 $xml = new \DomDocument(
'1.0',
'UTF-8');
178 $root = $xml->createElement(
'set');
179 $xml->appendChild($root);
181 $spec_xml = $xml->createElement(
'setSpec', $spec);
182 $root->appendChild($spec_xml);
184 $name_xml = $xml->createElement(
'setName', $name);
185 $root->appendChild($name_xml);
192 int $complete_list_size,
195 $xml = new \DomDocument(
'1.0',
'UTF-8');
196 $element = $xml->createElement(
200 $element->setAttribute(
'completeListSize', (
string) $complete_list_size);
201 $element->setAttribute(
'cursor', (
string) $cursor);
202 $xml->appendChild($element);
210 $xml = new \DomDocument(
'1.0',
'UTF-8');
213 $xml->appendChild($root);
216 $root->appendChild($date_xml);
218 $root->appendChild($request_xml);
220 $verb_xml = $xml->createElement($request->
verb()->value);
221 $root->appendChild($verb_xml);
223 foreach ($contents as $content_xml) {
224 $verb_xml->appendChild(
225 $xml->importNode($content_xml->documentElement,
true)
236 $xml = new \DomDocument(
'1.0',
'UTF-8');
239 $xml->appendChild($root);
242 $root->appendChild($date_xml);
244 $root->appendChild($request_xml);
246 foreach ($errors as $error_xml) {
248 $xml->importNode($error_xml->documentElement,
true)
257 $root = $xml->createElement(
'OAI-PMH');
260 'http://www.openarchives.org/OAI/2.0/' 264 'http://www.w3.org/2001/XMLSchema-instance' 267 'xsi:schemaLocation',
268 'http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd' 275 return $xml->createElement(
277 $this->getFormattedDateTime($this->getCurrentDateTime())
285 $request_xml = $xml->createElement(
289 if ($request->
verb() !== Verb::NULL) {
290 $request_xml->setAttribute(
291 Argument::VERB->value,
292 $request->
verb()->value
296 $request_xml->setAttribute(
if($err=$client->getError()) $namespace