Commit 26467b17 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

Merge branch 'op/tei2pdf' into 'master'

Modif du plugin tei2pdf

See merge request pdn-certic/MaX!101
parents cd16b39a 631b96bc
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -14,13 +14,17 @@ declare
function max.plugins.tei2pdf:fragmentToPDF($project, $routeDoc, $id){
    let $dbPath := max.config:getProjectDBPath($project)
    let $teiHeader := doc($dbPath || '/' || $routeDoc)//*:teiHeader
    let $content:=
    let $content:= max.api:getXMLByID($dbPath, $id)
    let $wrappedContent :=
        if($content//self::*:TEI)
        then($content)
        else(
        <TEI xmlns="http://www.tei-c.org/ns/1.0">
            <teiHeader>{$teiHeader}</teiHeader>
            <text>{max.api:getXMLByID($dbPath, $id)}</text>
            <text>{$content}</text>
        </TEI>
    (: return $content :)
    let $pdf := max.util:xml2pdf($content, max.util:getProjectFoXsl($project),$project,$id)
        )
    let $pdf := max.util:xml2pdf($wrappedContent, max.util:getProjectFoXsl($project),$project,$id)
    return
        (<rest:response>
            <http:response status="200">