2 require_once(dirname(__FILE__
) . "/../interface/globals.php");
3 require_once(dirname(__FILE__
) . "/../library/classes/Document.class.php");
6 $document_id = $_GET['doc_id'];
7 $d = new Document($document_id);
9 $url = preg_replace("|^(.*)://|","",$url);
11 // Collect filename and path
12 $from_all = explode("/",$url);
13 $from_filename = array_pop($from_all);
14 $from_pathname_array = array();
15 for ($i=0;$i<$d->get_path_depth();$i++
) {
16 $from_pathname_array[] = array_pop($from_all);
18 $from_pathname_array = array_reverse($from_pathname_array);
19 $from_pathname = implode("/",$from_pathname_array);
20 $temp_url = $GLOBALS['OE_SITE_DIR'] . '/documents/' . $from_pathname . '/' . $from_filename;
21 if (!file_exists($temp_url)) {
22 echo xl('The requested document is not present at the expected location on the filesystem or there are not sufficient permissions to access it.','','',' ') . $temp_url;
26 $xml = fread($f,filesize($url));
29 $xmlDom = new DOMDocument();
30 $xmlDom->loadXML($xml);
31 $ss = new DOMDocument();
32 $ss->load(dirname(__FILE__
).'/stylesheet/ccr.xsl');
33 $proc = new XSLTProcessor();
34 $proc->importStylesheet($ss);
35 $s_html = $proc->transformToXML($xmlDom);
38 $xmlDom = new DOMDocument();
39 $xmlDom->loadXML($xml);
40 $ss = new DOMDocument();
41 $ss->load(dirname(__FILE__
).'/stylesheet/cda.xsl');
42 $xslt = new XSLTProcessor();
43 $xslt->importStyleSheet($ss);
44 $html = $xslt->transformToXML($xmlDom);