Commit cb89f642 authored by Jérôme Chauveau's avatar Jérôme Chauveau
Browse files

xsl file path built from plugin setting

parent aa4a3c52
Loading
Loading
Loading
Loading

2html.xsl

deleted120000 → 0
+0 −1
Changes for 2html.xsl: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
certic-jats2html.xsl
 No newline at end of file
+20 −3
Changes for XML2HTMLPlugin.php: 20 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -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);
+0 −0

File moved.