예제 #1
0
 public function __construct()
 {
     // Creates an object of type DOMDocument
     // and exposes it as the attribute $tei
     $this->tei = new DOMDocument();
     $tei_dom = new TeiDom($_POST);
     $this->tei->loadXML($tei_dom->getTeiString());
     $this->xpath = new DOMXpath($this->tei);
     $this->xpath->registerNamespace('tei', TEI);
     $this->xpath->registerNamespace('html', HTML);
     $this->xpath->registerNamespace('anth', ANTH);
 }
예제 #2
0
<?php

include_once WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . "anthologize" . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'class-tei-dom.php';
$tei = new TeiDom($_POST);
$fileName = TeiDom::getFileName($_POST);
$ext = "xml";
header("Content-type: application/xml");
header("Content-Disposition: attachment; filename={$fileName}.{$ext}");
echo $tei->getTeiString();
die;