00001 <?php
00008 class STransXML extends STrans
00009 {
00013 protected $XMLObj = "";
00014
00019 public function doc() {
00020 return "XTransXML is the parent translator class for all PR2 translators"
00021 . " that take XML input and generate HTML output";
00022 }
00023
00024
00025
00026
00027
00033 public function getInFormat() {
00034 return 'xml';
00035 }
00036
00042 public function getOutFormat() {
00043 return 'html';
00044 }
00045
00052 public function translate ($si)
00053 {
00054 if(parent::translate($si) === false ) return false;
00055 $xml = SXMLHelper::parse($si->getSource());
00056 if ($xml === false) return false;
00057
00058
00059 if (('Main' == $si->getName()) && ($xml !== false))
00060 {
00061 $this->page->setSlot('CollName', $xml->name);
00062
00063 if (isset($xml->module)){
00064 $this->page->setSlot('ModuleName', $xml->module->name);
00065
00066 if (isset($xml->module->unit)){
00067 $this->page->setSlot('UnitName', $xml->module->unit->name);
00068
00069 if (isset($xml->module->unit->page))
00070 $this->page->setSlot('PageName', $xml->module->unit->page->pageData->name);
00071 }
00072 }
00073 }
00074
00075 return true;
00076 }
00077 }
00078
00079 ?>