1: <?php
2:
3: /**
4: * XMLWriter Class for DataCite_Sample_Metadata
5: * Useage: build DataCite IGSN Metadata XML
6: * @author sfrenzel
7: */
8:
9: class DataCite_Sample_Metadata_XMLWriter extends IGSN_Metadata_Base_XMLWriter {
10:
11: /**
12: *
13: * @param type $input
14: * @return bool
15: */
16: function writeXML($input) {
17: $sep = ';';
18: $COMMA = ',';
19: $dataciteW = new XMLWriter();
20: if (!$dataciteW) {
21: return false;
22: }
23: $dataciteW->openMemory();
24: $dataciteW->setIndent(true);
25: $dataciteW->setIndentString(' ');
26: $dataciteW->startDocument('1.0', 'UTF-8');
27:
28: $dataciteW->startElementNS(NULL, "resource", "http://datacite.org/schema/kernel-4");
29: $dataciteW->writeAttributeNs("xsi", "schemaLocation", "http://www.w3.org/2001/XMLSchema-instance", "http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4/metadata.xsd");
30:
31: return $this->writeElements($dataciteW, $input);
32: }
33:
34: }
35: