I am working on the digitization of historical resources on the TEI Publisher platform. For the users will have the possibility to download this texts in xml format and also in pdf. But for the pdf output the image did not come out.
In the xml file, the image is encoded in this way:
<?xml-model href=".rng" type="application/xml" schematypens=".0"?><?xml-model href=".rng" type="application/xml"
schematypens=";?>
<TEI xmlns=".0" xml:id="" rendition="tei:teisimple" xml:lang="es">
<teiHeader xml:lang="en">
<fileDesc>
<titleStmt>
<title></title>
<author></author>
<editor role="#scholarly"></editor>
<editor role="#technical" xml:id="">r</editor>
<editor role="#technical" xml:id=""></editor>
</titleStmt>
<editionStmt>
<edition n="1.0.0">
<date type="digitizedEd" when="2023-06-22">2023-06-22</date>
</edition>
</editionStmt>
<publicationStmt>
<publisher xml:id="pubstmt-publisher">
<Name></Name>
<ref type="url" target=/</ref>
</publisher>
<distributor xml:id="pubstmt-distributor">
<Name></Name>
<ref type="url" target=""></ref>
</distributor>
<pubPlace role="digitizedEd" xml:id="pubstmt-pubplace"> </pubPlace>
<availability xml:id="pubstmt-availability">
<licence target=".0" n="cc-by">
<p xml:id="p_ffjaztskfd">Creative
Commons Attribution 4.0 International (CC BY 4.0)</ref>.</p>
</licence>
</availability>
<date type="digitizedEd" when="2024-02-15">2024-02-15</date>
</publicationStmt>
<seriesStmt xml:id="seriesStmt">
<title level="s"</title>
<title level="j"></title>
<editor xml:id="TD">
<persName ref="gnd:" full="yes">
<surname full="yes"></surname>, <forename full="yes"></forename>
</persName>
</editor>
<editor xml:id="MPMQ">
<persName>
<surname full="yes"></surname>, <forename full="yes">r</forename>
</persName>
</editor>
</seriesStmt>
<sourceDesc>
<p></p>
<p> <ref source="">.</ref>
</p>
</sourceDesc>
</fileDesc>
<encodingDesc xml:lang="es">
<classDecl>
<taxonomy>
<desc></desc>
<category xml:id="">
<catDesc></catDesc>
</category>
<category>
<desc></desc>
<category xml:id="">
<catDesc></catDesc>
</category>
<category xml:id="">
<catDesc></catDesc>
</category>
<category xml:id="">
<catDesc></catDesc>
</category>
<category xml:id="">
<catDesc></catDesc>
</category>
<category xml:id="">
<catDesc></catDesc>
</category>
</category>
</taxonomy>
</classDecl>
</encodingDesc>
<profileDesc>
<textClass>
<catRef target=""/>
<keywords scheme="palabras-clave" xml:lang="es">
<list>
<item></item>
<item></item>
<item></item>
<item></item>
<item></item>
</list>
</keywords>
</textClass>
</profileDesc>
<revisionDesc>
<listChange>
<change when="" who="">Initial Encoding<date></date>
</change>
</listChange>
</revisionDesc>
</teiHeader>
<text>
<front>
<titlePage>
<docTitle>
<titlePart><note n="*" place="end" xml:id="footnote-DCH"></note>
</titlePart>
</docTitle>
<docAuthor><note n="**" place="end" xml:id="footnote-author"/>
</docAuthor>
</titlePage>
</front>
<body>
<div n="1">
<head>1. Introducción</head>
<p></p>
...
<div n="6">
<head>6. </head>
<p> <term></term> .</p>
<graphic url="../dch/resources/images/palio_imagem.png"/>
the master.fo.xml that I wrote:
<fo:layout-master-set xmlns:xsl="; xmlns:fo=";>
<fo:simple-page-master master-name="page-left" page-height="297mm" page-width="210mm" margin-bottom="10mm" margin-top="10mm" margin-left="36mm" margin-right="18mm">
<fo:region-body margin-bottom="10mm" margin-top="16mm"/>
<fo:region-before region-name="head-left" extent="10mm"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="page-right" page-height="297mm" page-width="210mm" margin-bottom="10mm" margin-top="10mm" margin-left="18mm" margin-right="36mm">
<fo:region-body margin-bottom="10mm" margin-top="16mm"/>
<fo:region-before region-name="head-right" extent="10mm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="page-content">
<xsl:choose>
<xsl:when test="graphic">
<fo:external-graphic width="auto" height="auto" content-width="scale-to-fit" content-height="scale-to-fit" src="{$graphic}"/>
</xsl:when>
<xsl:otherwise>
<fo:block>dont found it.</fo:block>
</xsl:otherwise>
</xsl:choose>
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="page-right" odd-or-even="odd"/>
<fo:conditional-page-master-reference master-reference="page-left" odd-or-even="even"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
Can you have any idea why the image dont printed? Thanks a lot .
The repository from TEI Publisher is here:
I tried another "css media print" command, but I did not have success.
I am working on the digitization of historical resources on the TEI Publisher platform. For the users will have the possibility to download this texts in xml format and also in pdf. But for the pdf output the image did not come out.
In the xml file, the image is encoded in this way:
<?xml-model href="http://www.tei-c./release/xml/tei/custom/schema/relaxng/tei_all.rng" type="application/xml" schematypens="http://relaxng./ns/structure/1.0"?><?xml-model href="http://www.tei-c./release/xml/tei/custom/schema/relaxng/tei_all.rng" type="application/xml"
schematypens="http://purl.oclc./dsdl/schematron"?>
<TEI xmlns="http://www.tei-c./ns/1.0" xml:id="" rendition="tei:teisimple" xml:lang="es">
<teiHeader xml:lang="en">
<fileDesc>
<titleStmt>
<title></title>
<author></author>
<editor role="#scholarly"></editor>
<editor role="#technical" xml:id="">r</editor>
<editor role="#technical" xml:id=""></editor>
</titleStmt>
<editionStmt>
<edition n="1.0.0">
<date type="digitizedEd" when="2023-06-22">2023-06-22</date>
</edition>
</editionStmt>
<publicationStmt>
<publisher xml:id="pubstmt-publisher">
<Name></Name>
<ref type="url" target=/</ref>
</publisher>
<distributor xml:id="pubstmt-distributor">
<Name></Name>
<ref type="url" target=""></ref>
</distributor>
<pubPlace role="digitizedEd" xml:id="pubstmt-pubplace"> </pubPlace>
<availability xml:id="pubstmt-availability">
<licence target="https://creativecommons./licenses/by/4.0" n="cc-by">
<p xml:id="p_ffjaztskfd">Creative
Commons Attribution 4.0 International (CC BY 4.0)</ref>.</p>
</licence>
</availability>
<date type="digitizedEd" when="2024-02-15">2024-02-15</date>
</publicationStmt>
<seriesStmt xml:id="seriesStmt">
<title level="s"</title>
<title level="j"></title>
<editor xml:id="TD">
<persName ref="gnd:" full="yes">
<surname full="yes"></surname>, <forename full="yes"></forename>
</persName>
</editor>
<editor xml:id="MPMQ">
<persName>
<surname full="yes"></surname>, <forename full="yes">r</forename>
</persName>
</editor>
</seriesStmt>
<sourceDesc>
<p></p>
<p> <ref source="">https://dch.hypotheses..</ref>
</p>
</sourceDesc>
</fileDesc>
<encodingDesc xml:lang="es">
<classDecl>
<taxonomy>
<desc></desc>
<category xml:id="">
<catDesc></catDesc>
</category>
<category>
<desc></desc>
<category xml:id="">
<catDesc></catDesc>
</category>
<category xml:id="">
<catDesc></catDesc>
</category>
<category xml:id="">
<catDesc></catDesc>
</category>
<category xml:id="">
<catDesc></catDesc>
</category>
<category xml:id="">
<catDesc></catDesc>
</category>
</category>
</taxonomy>
</classDecl>
</encodingDesc>
<profileDesc>
<textClass>
<catRef target=""/>
<keywords scheme="palabras-clave" xml:lang="es">
<list>
<item></item>
<item></item>
<item></item>
<item></item>
<item></item>
</list>
</keywords>
</textClass>
</profileDesc>
<revisionDesc>
<listChange>
<change when="" who="">Initial Encoding<date></date>
</change>
</listChange>
</revisionDesc>
</teiHeader>
<text>
<front>
<titlePage>
<docTitle>
<titlePart><note n="*" place="end" xml:id="footnote-DCH"></note>
</titlePart>
</docTitle>
<docAuthor><note n="**" place="end" xml:id="footnote-author"/>
</docAuthor>
</titlePage>
</front>
<body>
<div n="1">
<head>1. Introducción</head>
<p></p>
...
<div n="6">
<head>6. </head>
<p> <term></term> .</p>
<graphic url="../dch/resources/images/palio_imagem.png"/>
the master.fo.xml that I wrote:
<fo:layout-master-set xmlns:xsl="http://www.w3./1999/XSL/Transform" xmlns:fo="http://www.w3./1999/XSL/Format">
<fo:simple-page-master master-name="page-left" page-height="297mm" page-width="210mm" margin-bottom="10mm" margin-top="10mm" margin-left="36mm" margin-right="18mm">
<fo:region-body margin-bottom="10mm" margin-top="16mm"/>
<fo:region-before region-name="head-left" extent="10mm"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="page-right" page-height="297mm" page-width="210mm" margin-bottom="10mm" margin-top="10mm" margin-left="18mm" margin-right="36mm">
<fo:region-body margin-bottom="10mm" margin-top="16mm"/>
<fo:region-before region-name="head-right" extent="10mm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="page-content">
<xsl:choose>
<xsl:when test="graphic">
<fo:external-graphic width="auto" height="auto" content-width="scale-to-fit" content-height="scale-to-fit" src="{$graphic}"/>
</xsl:when>
<xsl:otherwise>
<fo:block>dont found it.</fo:block>
</xsl:otherwise>
</xsl:choose>
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="page-right" odd-or-even="odd"/>
<fo:conditional-page-master-reference master-reference="page-left" odd-or-even="even"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
Can you have any idea why the image dont printed? Thanks a lot .
The repository from TEI Publisher is here: https://github/eeditiones/tei-publisher-app
I tried another "css media print" command, but I did not have success.
Share Improve this question edited Dec 10, 2024 at 7:42 lfurini 3,7884 gold badges34 silver badges50 bronze badges asked Nov 19, 2024 at 14:19 ndso86ndso86 111 silver badge2 bronze badges 2 |2 Answers
Reset to default 0As @StefanHegny noted, the structure of your XSL-FO is not correct.
The diagram for the structure of an XSL-FO document from the XSL 1.1 Recommendation is:
The document element is fo:root
. Some of the elements shown in the diagram are optional. Your content goes inside the fo:flow
in an fo:page-sequence
.
Additionally, fo:external-graphic
is an inline FO, so it should be inside an fo:block
element and not just a child of the fo:flow
element.
You can find examples of XSL-FO usage in the Antenna House 'XSL-FO Samples Collection' at https://www.antennahouse/xsl-fo-samples. You can download the XSL-FO file for any sample to see how it was made.
thank you for your comments and advice. The problem was solved via ODD. Due to expired certifications, I had to put in the full path and that's how it worked
graphic
in the top level of the input xml tree, is the xml tree free of namespaces? Then changingtest="graphic"
totest="graphic/@url"
andsrc="{$graphic}"
tosrc="graphic/@url"
should do it, if the graphic url is likedata:image/<supported type>;base64,...
Otherwise we might need more information (larger context of the xml). It seems you are using the master.fo as xslt stylesheet. Also I am not sure if placing something in thelayout-master-set
will show it without being instantiated, can't check at the moment but soon experts will drop in – Stefan Hegny Commented Nov 21, 2024 at 14:45