You are here

protected function views_oai_pmh_plugin_style::xml_init in Views OAI-PMH 7.3

Creates the DOMDocument for the OAI-PMH response.

Creates the DOMDocument for the OAI-PMH response. with elements that are common to all responses.

1 call to views_oai_pmh_plugin_style::xml_init()
views_oai_pmh_plugin_style::render in plugins/views_oai_pmh_plugin_style.inc
Render.

File

plugins/views_oai_pmh_plugin_style.inc, line 755
Contains the base OAI-PMH style plugin.

Class

views_oai_pmh_plugin_style
Views OAI-PMH_plugin style.

Code

protected function xml_init() {
  $this->xml = new DOMDocument('1.0', 'UTF-8');
  $this->xml->preserveWhitespace = FALSE;
  $this->xml->formatOutput = TRUE;
  $this->xml_root = $this->xml
    ->createElement('OAI-PMH');
  $this->xml_root = $this->xml
    ->appendChild($this->xml_root);
  $this->xml_root
    ->setAttribute('xmlns', 'http://www.openarchives.org/OAI/2.0/');
  $this->xml_root
    ->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
  $this->xml_root
    ->setAttribute('xsi:schemaLocation', 'http://www.openarchives.org/OAI/2.0/   http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd');
  $this
    ->xml_append_children($this->xml_root, array(
    'responseDate' => $this->request->response_date,
  ));
}