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); }
<?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;