Skip to content
Snippets Groups Projects
Commit db25456f authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

xsl file path built from plugin setting

parent c1eb8fed
No related branches found
No related tags found
No related merge requests found
certic-jats2html.xsl
\ No newline at end of file
......@@ -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);
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment