diff --git a/2html.xsl b/2html.xsl deleted file mode 120000 index b49720f5ef9a78c4463f5db383b4fe2a7682c5b5..0000000000000000000000000000000000000000 --- a/2html.xsl +++ /dev/null @@ -1 +0,0 @@ -certic-jats2html.xsl \ No newline at end of file diff --git a/XML2HTMLPlugin.php b/XML2HTMLPlugin.php index dc7b9b24f3fe3c2bd3699f2a78d9620a76d8b032..cc0c93c07b44e9fd8f90cc783f89451aad6ec5dd 100644 --- a/XML2HTMLPlugin.php +++ b/XML2HTMLPlugin.php @@ -64,9 +64,22 @@ class XML2HTMLPlugin extends GenericPlugin $html = file_get_contents($htmlFile); //make transfo only if html does not exist if(!$html) { + //get sources format from settings + $context = Application::get() + ->getRequest() + ->getContext(); + + $format = $this->getSetting( + $context->getId(), + 'format' + ); + + if($format == NULL || $format == '') + $format = 'JATS';//default value is JATS + $xmlFilePath = XML2HTMLPlugin::unzipXMLArchive($filePath); $html = $this->resolveZipImagePaths( - XML2HTMLPlugin::transform($xmlFilePath), + XML2HTMLPlugin::transform($xmlFilePath, $format), $submissionId, $galleyId, $xmlFilePath, $this->getRequest(), @@ -183,11 +196,15 @@ class XML2HTMLPlugin extends GenericPlugin } static function transform( - string $xmlFilePath + string $xmlFilePath, + string $format ) { + + + $xslFileName = strtolower($format) . '2html.xsl'; ////// xslt transfo - $xsltPath = dirname(__FILE__) . DIRECTORY_SEPARATOR . '2html.xsl'; + $xsltPath = dirname(__FILE__) . DIRECTORY_SEPARATOR . $xslFileName; // Load the XML source $xml = new DOMDocument; $xml->load($xmlFilePath); diff --git a/certic-jats2html.xsl b/jats2html.xsl similarity index 100% rename from certic-jats2html.xsl rename to jats2html.xsl