Re: XMLmind XSL Utility 4.3.2, message d'erreur (now, 5.2.0)
ANDRE Marie-Agnes <[email protected]> Tue, 28 Apr 2015 07:17:59 +0000
| Newsgroups | gmane.text.xml.xfc.general |
|---|---|
| Message-ID | <[email protected]> |
Dear M. Hussein Shafie, It's ok in English. Thank you for your answer. Yes, that's a long time since using the software. So, I've done it again in a most recent version (5.2.0) and here is the message I have: Converting "C:\Users\mandre\Documents\w_essais\projet_crea_xml\Essai_ts.xml" to "C:\Users\mandre\Documents\w_essais\projet_crea_xml\Essai_ts.pdf" using conversion specification "ts-test"... Compiling XSLT stylesheet "C:\Users\mandre\Documents\w_essais\projet_crea_xml\Essai_ts.xsl"... XSLT stylesheet compiled in 0.687s. Transforming "C:\Users\mandre\Documents\w_essais\projet_crea_xml\Essai_ts.xml" to "C:\Users\mandre\Documents\w_essais\projet_crea_xml\xslu6566132020306693465.tmp" using XSLT stylesheet "C:\Users\mandre\Documents\w_essais\projet_crea_xml\Essai_ts.xsl"... XSLT transformation completed in 0.078s. Converting "C:\Users\mandre\Documents\w_essais\projet_crea_xml\xslu6566132020306693465.tmp" to "C:\Users\mandre\Documents\w_essais\projet_crea_xml\Essai_ts.pdf" using XSL-FO processor "FOP"... javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: Content is not allowed in prolog. +--------------------------------------- | com.icl.saxon.IdentityTransformer.transform(IdentityTransformer.java:61) | com.xmlmind.xmleditext.fop1_foprocessor.FOP.doProcessFO(FOP.java:125) | com.xmlmind.xmleditext.fop1_foprocessor.FOP.processFO(FOP.java:82) | com.xmlmind.xslutil.ConvertTask.processFO(ConvertTask.java:1000) | com.xmlmind.xslutil.ConvertTask.doRun2(ConvertTask.java:551) | com.xmlmind.xslutil.ConvertTask.doRun(ConvertTask.java:135) | com.xmlmind.xslutil.ConvertTask.run(ConvertTask.java:112) | java.lang.Thread.run(Unknown Source) +--------------------------------------- CAUSE: org.xml.sax.SAXParseException: Content is not allowed in prolog. +--------------------------------------- | org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) | org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) | com.icl.saxon.IdentityTransformer.transform(IdentityTransformer.java:59) | com.xmlmind.xmleditext.fop1_foprocessor.FOP.doProcessFO(FOP.java:125) | com.xmlmind.xmleditext.fop1_foprocessor.FOP.processFO(FOP.java:82) | com.xmlmind.xslutil.ConvertTask.processFO(ConvertTask.java:1000) | com.xmlmind.xslutil.ConvertTask.doRun2(ConvertTask.java:551) | com.xmlmind.xslutil.ConvertTask.doRun(ConvertTask.java:135) | com.xmlmind.xslutil.ConvertTask.run(ConvertTask.java:112) | java.lang.Thread.run(Unknown Source) +--------------------------------------- Please find enclosed drafts of the xml and xsl files to help understand where is the mistake. It's been a long time without doing a completely new xsl stylesheet, so it can explain I forget things. Thanks again. Regards, Mlle André -----Message d'origine----- De : Hussein Shafie [mailto:[email protected]] Envoyé : lundi 27 avril 2015 16:52 À : ANDRE Marie-Agnes Cc : [email protected] Objet : Re: [XFC] XMLmind XSL Utility 4.3.2, message d'erreur On 04/27/2015 11:46 AM, ANDRE Marie-Agnes wrote: > > Je travaille sur un projet pour convertir un fichier xml en pdf en > utilisant une feuille de transformation en xsl-fo. > > Je viens que de débuter cette dernière. > > Quand je compile dans le logiciel. Il bloque une fois qu'il arrive à > la partie FO, j'ai un message d'erreur : > > « org.xml.sax.SAXParseException: Content is not allowed in prolog. » > > J'ai vérifié mon prologue et je ne vois pas où est le problème. > > Code incluant la balise racine : > > <?xml version="1.1" encoding="iso-8859-1"?> > > <!DOCTYPE xsl:stylesheet [ > > <!ENTITY nbsp " "> > > ]> > > <xsl:stylesheet version="1.0" > xmlns:fo="http://www.w3.org/1999/XSL/Format" > > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > > > xmlns:java="http://xml.apache.org/xslt/java"> > > Avez-vous une idée pour savoir ce qui me bloque et m'empêche de continuer ? > Sorry but this public, moderated, mailing-list is in English. --> It's hard to help you because 1) XMLmind XSL Utility 4.3.2 is a very old version of our software and as such, no longer supported by us; 2) you give us very few details about the issue. --- Quand je compile dans le logiciel. Il bloque une fois qu'il arrive à la partie FO, j'ai un message d'erreur : ... --- --- When I compile in the software. It hangs when it reaches the FO part, I have a error message: ... --- is not precise enough. Please select the whole contents of XMLmind XSL Utility ``internal console'' (what's below button "Convert"), use Ctrl-C to copy it to the clipboard and then send us all the messages printed there by our tool. --> You copied in your email just the very beginning of your XSLT stylesheet. These few lines are OK. However the error you have probably comes from the *body* of your XSLT stylesheet. Let's suppose your input document (that is, the document you want to convert to PDF; not your XSLT stylesheet) contains: <my:doc xmlns:my="http://EDQM.eu/ns/my"> ... </my:doc> If your XSLT stylesheet does *not* have a template which matches root element my:doc, then the FO file it generates may contain plain text (due to default XSLT templates) and hence you'll get "Content is not allowed in prolog". In a nutshell, the problem almost certainly comes from your XSLT stylesheet and/or from a mismatch between your XSLT stylesheet and your input document. -- XMLmind FO Converter Support List [email protected] http://www.xmlmind.com/mailman/listinfo/xfc-support
Essai_ts.xsl
(text/xml, 2.1 KB)
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
]>
<xsl:stylesheet xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="section/titre_partie" mode="toc">
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master master-name="page">
<fo:region-body region-name="body" column-count="2"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="page">
<fo:flow flow-name="body">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{generate-id(.)}">
<xsl:number level="multiple" count="section" format="1. "/>
<xsl:apply-templates/>
</fo:basic-link>
<xsl:text> </xsl:text>
<fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt" leader-length.maximum="100%" leader-pattern="dots"/>
<xsl:text> </xsl:text>
<fo:page-number-citation ref-id="{generate-id(.)}"/>
</fo:block>
<xsl:apply-templates select="../corps_h1/titre_2" mode="toc"/>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="corps_h1/titre_2" mode="toc">
<fo:block start-indent="10mm" text-align-last="justify">
<fo:basic-link internal-destination="{generate-id(.)}">
<xsl:number level="multiple" count="section|corps_h1" format="1.1 "/>
<xsl:apply-templates/>
</fo:basic-link>
<xsl:text> </xsl:text>
<fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt"
leader-length.maximum="100%" leader-pattern="dots"/>
<xsl:text> </xsl:text>
<fo:page-number-citation ref-id="{generate-id(.)}"/>
</fo:block>
</xsl:template>
<xsl:template match="section/titre_partie">
<fo:block id="{generate-id(.)}">
<xsl:number level="multiple" count="section" format="1. "/>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="corps_h1/titre_2">
<fo:block id="{generate-id(.)}">
<xsl:number level="multiple" count="section|corps_h1" format="1.1 "/>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
</xsl:stylesheet>
Essai_ts.xml
(text/xml, 6 KB)
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE blood_guide SYSTEM "Essai_ts.dtd" [ <!ENTITY nbsp " "> <!ENTITY W_B "Whole B."> ]> <blood_guide> <metadonnees> <titre_guide>Guide </titre_guide> <num_chap_guide id="chap05">Chapter 5</num_chap_guide> <titre_chap>C mo</titre_chap> <date></date> <auteur></auteur> <securite></securite> </metadonnees> <section> <titre_partie>&W_B; components</titre_partie> <corps_partie> <titre_1>&W_B;</titre_1> <corps_h1> <titre_2>Definition and properties</titre_2> <corps_h2> <para> <i>&W_B;</i> is blood ...</para> <para> <i>&W_B;</i> for ...</para> </corps_h2> <titre_2>Preparation</titre_2> <corps_h2> <para> By definition, ... of <i>&W_B;</i>.</para> </corps_h2> <titre_2>Requirements</titre_2> <corps_h2> <para><xref idref="table01"/> lists the requirements. ...</para> <table> <titre_table id="table01">Table 5A-1</titre_table> <thead id="thead_table01"> <tr> <th>Parameter</th> <th>Requirements</th> <th id="note_table01">Frequency </th> </tr> </thead> <tbody> <tr> <td>ABO</td> <td>Grouping</td> <td>All units</td> </tr> <tr> <td>Anti</td> <td>Negative</td> <td>All units</td> </tr> <tr> <td>H</td> <td>Negative</td> <td>All units</td> </tr> <tr> <td>Anti</td> <td>Negative </td> <td>All units</td> </tr> <tr> <td>Volume</td> <td>450 mL ± 50 mL volume <br/> A non-standard </td> <td>1 per cent </td> </tr> <tr> <td>Ha</td> <td>Minimum 45 g </td> <td>4 units</td> </tr> <tr> <td>Hae</td> <td>< 0.8 per cent s</td> <td>4 units </td> </tr> </tbody> <tfoot> <tr> <td colspan="3" idref="note_table01">If different from ‘All units’, </td> </tr> </tfoot> </table> </corps_h2> <titre_2>Storage </titre_2> <corps_h2> <para> <i>&W_B;</i> for ...</para> <para> <i>&W_B;</i> for preparation ... from <i>&W_B;</i>.</para> </corps_h2> <titre_2>Labelling</titre_2> <corps_h2> <para>The labelling must ...</para> <bullet> identification;</bullet> <bullet>identity number;</bullet> <bullet>administration set.</bullet> </corps_h2> <titre_2>Warnings</titre_2> <corps_h2> <para>Compatibility of <i>&W_B;</i> for .</para> <para>RhD</para> <bullet>metabolic;</bullet> <bullet>transfusion;</bullet> <bullet>iron.</bullet> </corps_h2> </corps_h1> <titre_1>&W_B;</titre_1> <corps_h1> <titre_2>Definition </titre_2> <corps_h2> <para> <i>&W_B;</i>, <i>Leu</i>... <i>&W_B;</i> by ...</para> <para> <i>&W_B;</i>, <i>LD</i> contains.</para> <para> <i>&W_B;</i>, <i>LD</i> normally contains less than 1.0 × 10<exposant>6</exposant></para> </corps_h2> <titre_2>Preparation</titre_2> <corps_h2> <para>Generally ...</para> </corps_h2> <titre_2>Requirements</titre_2> <corps_h2> <para><xref idref="table02"/>(see also Chapter 9).</para> <table> <titre_table id="table02">Table 5A-2</titre_table> <thead id="thead_table02"> <tr> <th>Parameter</th> <th>Requirements</th> <th id="note_table02">Frequency of control</th> </tr> </thead> <tbody> <tr> <td>ABO</td> <td>Grouping</td> <td>All units</td> </tr> <tr> <td>Anti</td> <td>Negative</td> <td>All units</td> </tr> <tr> <td>HB</td> <td>Negative </td> <td>All units</td> </tr> <tr> <td>Anti</td> <td>Negative </td> <td>All units</td> </tr> <tr> <td>Volume</td> <td>450 ± 50 mL <br/>A non-standard </td> <td>1 per cent </td> </tr> <tr> <td>Hae</td> <td>Minimum </td> <td>1 per cent h</td> </tr> <tr> <td id="note_table03">Residual</td> <td>< 1 × 10<exposant>6</exposant> per unit by count</td> <td>1 per cent </td> </tr> <tr> <td>Hae</td> <td>< 0.8 per cent </td> <td>4 units per mont</td> </tr> </tbody> <tfoot> <tr> <td colspan="3" idref="note_table02">If different ...</td> <td colspan="3" idref="note_table03">These requirements ..d.</td> </tr> </tfoot> </table> </corps_h2> <titre_2>Storage </titre_2> <corps_h2> <para> <i>&W_B;</i>, <i>LD</i> must ...</para> <para>Validated ...</para> </corps_h2> <titre_2>Labelling</titre_2> <corps_h2> <para>The labelling:</para> <bullet>the producer’s;</bullet> <bullet>the unique;</bullet> <bullet>the name ;</bullet> <bullet>administration set.</bullet> </corps_h2> <titre_2>Warnings</titre_2> <corps_h2> <para>Compatibility of <i>&W_B;</i>, <i>LD</i> with ...</para> <para>RhD...</para> <para><i>&W_B;</i>, </para> <bullet><i>LD</i> is </bullet> <bullet>hae;</bullet> <bullet>non-hae;</bullet> <bullet>iron.</bullet> </corps_h2> </corps_h1> </corps_partie> <titre_partie>Red </titre_partie> <corps_partie> <titre_1></titre_1> <corps_h1><titre_2>Definition </titre_2> <corps_h2> <para> <i>&W_B;</i> is ...</para> <para> <i>&W_B;</i> for ...</para> </corps_h2></corps_h1> </corps_partie> </section> </blood_guide>