Error transform from xml xsl-fo to pdf

Here should go questions about transforming XML with XSLT and FOP.
arka
Posts: 6

Error transform from xml xsl-fo to pdf

Wed Jun 08, 2011 11:36 am

Hi everybody!
i'm here because i'm in troble with oxygen =p
it's the first time i use it and i don't understand what i'm doing wrong.
i try to convert xml & xsl to a pdf doc without succes, i try it with samples from internet before learn xsl-fo.
For exemple:
i open an xml & an xsl file on oXygen (the contents are in french i hope it's not a problem for you^^):
xml

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1"?>

<CINEMA>
  <NOM>Epée de bois</NOM>
  <ADRESSE>100, rue Mouffetard</ADRESSE>
  <METRO>Censier-Daubenton</METRO>

 <SALLE NO='1' PLACES='320'>
  <FILM>
    <TITRE>Alien</TITRE>
    <AUTEUR>Ridley Scott</AUTEUR>
    <ANNEE>1979</ANNEE>
    <GENRE>Science-fiction</GENRE>
    <PAYS>Etats Unis</PAYS>
    <RESUME>Près d'un vaisseau spatial échoué sur une lointaine
       planète, des Terriens en mission découvrent de bien étranges
       "oeufs". Ils en ramènent un à bord, ignorant qu'ils viennent
       d'introduire parmi eux un huitième passager particulièrement
       féroce et meurtrier.
    </RESUME>
  </FILM>
  <REMARQUE>Réservation conseillée</REMARQUE>
  <SEANCES>
        <SEANCE>15:00</SEANCE>
        <SEANCE>18:00</SEANCE>
        <SEANCE>21:00</SEANCE>
   </SEANCES>
  </SALLE>

 <SALLE NO='2' PLACES='120'>
  <FILM>
    <TITRE>Vertigo</TITRE>
    <AUTEUR>Alfred Hitchcock</AUTEUR>
    <ANNEE>1958</ANNEE>
    <GENRE>Drame</GENRE>
    <PAYS>Etats Unis</PAYS>
    <RESUME>Scottie Ferguson, ancien inspecteur de police, est sujet
       au vertige depuis qu'il a vu mourir son collègue. Elster, son
       ami, le charge de surveiller sa femme, Madeleine, ayant des
       tendances suicidaires. Amoureux de la jeune femme Scottie ne
       remarque pas le piège qui se trame autour de lui et dont il va
       être la victime...
    </RESUME>
    </FILM>
    <SEANCES>
        <SEANCE>22:00</SEANCE>
    </SEANCES>
 </SALLE>

<SALLE NO='3' PLACES='50'>
  <FILM>
    <TITRE>Sleepy Hollow</TITRE>
    <AUTEUR>Tim Burton</AUTEUR>
    <ANNEE>1999</ANNEE>
    <GENRE>Fantastique</GENRE>
    <PAYS>USA</PAYS>
    <RESUME>Nouvelle Angleterre, 1799. A Sleepy Hollow, plusieurs
       cadavres sont retrouvés décapités. La rumeur attribue ces
       meurtres à un cavalier lui-même sans tête. Mais le fin limier
       new-yorkais Ichabod Crane ne croit pas en ses
       aberrations. Tombé sous le charme de la vénéneuse Katrina, il
       mène son enquête au coeur des sortilèges de Sleepy
       Hollow..
    </RESUME>
  </FILM>
  <SEANCES>
    <SEANCE>19:30</SEANCE>
    <SEANCE>22:00</SEANCE>
  </SEANCES>
</SALLE>


</CINEMA>


xsl

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">

<xsl:template match="/">
  <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <!-- Définition des mises en page -->
    <fo:layout-master-set>
      <fo:simple-page-master master-name="page"
              page-height="297mm" page-width="210mm"
              margin-top="10mm" margin-bottom="10mm"
              margin-left="20mm" margin-right="20mm">
   <fo:region-body margin-top="15mm" margin-bottom="15mm"/>
   <fo:region-before extent="20mm" />
   <fo:region-after extent="10mm"/>
      </fo:simple-page-master>
    </fo:layout-master-set>
    <!-- Définition du contenu -->
    <fo:page-sequence master-reference="page">
      <fo:flow flow-name='xsl-region-body' font-size="20pt">
   <xsl:apply-templates select="CINEMA"/>
      </fo:flow>
    </fo:page-sequence>
  </fo:root>
</xsl:template>

<xsl:template match="CINEMA">
  <fo:block text-align="center">
    <fo:block font-size="40pt" font-weight="bold" space-after="20pt">
      <!-- Sélection du nom du cinema       -->
      <xsl:value-of select="NOM"/>         
    </fo:block>
    <!-- Sélection de l'adresse du cinema   -->
    <xsl:value-of select="ADRESSE"/>
    <!-- Sélection du métro près du cinema     -->
    (<xsl:value-of select="METRO"/>)
    </fo:block>
    <fo:block space-before="20pt">
    <!-- Transformer chaque salle -->
    <xsl:apply-templates select="SALLE"/> 
  </fo:block>
</xsl:template>

<xsl:template match="SALLE">
  <fo:block text-align="center" space-before="40pt">
    <fo:inline font-weight="bold" font-size="26pt">
      <!-- Sélection du titre du film   -->
      <xsl:value-of select="FILM/TITRE"/>
    </fo:inline> de
    <fo:inline font-style="italic">
      <!-- Sélection de l'auteur du film   -->
      <xsl:value-of select="FILM/AUTEUR"/>
    </fo:inline>
    <fo:block space-before="5pt">
      <!-- Sélection de l'année et du pays du film   -->
      (<xsl:value-of select="FILM/PAYS"/>,
       <xsl:value-of select="FILM/ANNEE"/>)
    </fo:block>
  </fo:block>
  <fo:block space-before="10pt">
    <!-- Sélection du résumé du film   -->
    <xsl:value-of select="FILM/RESUME"/>
  </fo:block>
  <fo:block space-before="10pt">
    <fo:inline font-weight="bold">
      <!-- Sélection du numéro de salle   -->
      Salle <xsl:value-of select="@NO"/>
    </fo:inline>
    (<xsl:value-of select="@PLACES"/> places) :
    <!-- Sélection des séances   -->
    <xsl:for-each select="SEANCES/SEANCE">
      <xsl:value-of select="."/> -
    </xsl:for-each>
    <!-- Sélection de la remarque   -->
    <xsl:value-of select="REMARQUE"/>
  </fo:block>
</xsl:template>
</xsl:stylesheet>


and when i process to the transformation fo pdf, i've got this error:

Code: Select all

SystemID: C:\Temp\Essaie xml xsl fo\test xml xsl fo\cinema.xml
Description: The process 'FOP' ended with code: 1.
The error was:
8 juin 2011 09:32:10 org.apache.fop.cli.Main startFOP
GRAVE: Exception
net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: Error: First element must be the fo:root formatting object. Found (Namespace URI: "", Local Name: "CINEMA") instead. Please make sure you're producing a valid XSL-FO document.
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)

---------

net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: Error: First element must be the fo:root formatting object. Found (Namespace URI: "", Local Name: "CINEMA") instead. Please make sure you're producing a valid XSL-FO document.
   at net.sf.saxon.event.ContentHandlerProxy.handleSAXException(ContentHandlerProxy.java:521)
   at net.sf.saxon.event.ContentHandlerProxy.startContent(ContentHandlerProxy.java:375)
   at net.sf.saxon.event.NamespaceReducer.startContent(NamespaceReducer.java:197)
   at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:364)
   at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:371)
   at net.sf.saxon.event.Sender.send(Sender.java:185)
   at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)
Caused by: org.apache.fop.fo.ValidationException: Error: First element must be the fo:root formatting object. Found (Namespace URI: "", Local Name: "CINEMA") instead. Please make sure you're producing a valid XSL-FO document.
   at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:292)
   at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
   at net.sf.saxon.event.ContentHandlerProxy.startContent(ContentHandlerProxy.java:362)
   ... 19 more
---------
org.apache.fop.fo.ValidationException: Error: First element must be the fo:root formatting object. Found (Namespace URI: "", Local Name: "CINEMA") instead. Please make sure you're producing a valid XSL-FO document.
   at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:292)
   at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
   at net.sf.saxon.event.ContentHandlerProxy.startContent(ContentHandlerProxy.java:362)
   at net.sf.saxon.event.NamespaceReducer.startContent(NamespaceReducer.java:197)
   at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:364)
   at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:371)
   at net.sf.saxon.event.Sender.send(Sender.java:185)
   at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)

and this one:

Code: Select all

SystemID: C:\Temp\Essaie xml xsl fo\test xml xsl fo\cinema1.xsl
Description: The process 'FOP' ended with code: 1.
The error was:
8 juin 2011 09:32:11 org.apache.fop.cli.Main startFOP
GRAVE: Exception
net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: Error: First element must be the fo:root formatting object. Found (Namespace URI: "http://www.w3.org/1999/XSL/Transform", Local Name: "stylesheet") instead. Please make sure you're producing a valid XSL-FO document.
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)

---------

net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: Error: First element must be the fo:root formatting object. Found (Namespace URI: "http://www.w3.org/1999/XSL/Transform", Local Name: "stylesheet") instead. Please make sure you're producing a valid XSL-FO document.
   at net.sf.saxon.event.ContentHandlerProxy.handleSAXException(ContentHandlerProxy.java:521)
   at net.sf.saxon.event.ContentHandlerProxy.startContent(ContentHandlerProxy.java:375)
   at net.sf.saxon.event.NamespaceReducer.startContent(NamespaceReducer.java:197)
   at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:364)
   at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:371)
   at net.sf.saxon.event.Sender.send(Sender.java:185)
   at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)
Caused by: org.apache.fop.fo.ValidationException: Error: First element must be the fo:root formatting object. Found (Namespace URI: "http://www.w3.org/1999/XSL/Transform", Local Name: "stylesheet") instead. Please make sure you're producing a valid XSL-FO document.
   at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:292)
   at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
   at net.sf.saxon.event.ContentHandlerProxy.startContent(ContentHandlerProxy.java:362)
   ... 19 more
---------
org.apache.fop.fo.ValidationException: Error: First element must be the fo:root formatting object. Found (Namespace URI: "http://www.w3.org/1999/XSL/Transform", Local Name: "stylesheet") instead. Please make sure you're producing a valid XSL-FO document.
   at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:292)
   at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
   at net.sf.saxon.event.ContentHandlerProxy.startContent(ContentHandlerProxy.java:362)
   at net.sf.saxon.event.NamespaceReducer.startContent(NamespaceReducer.java:197)
   at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:364)
   at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:371)
   at net.sf.saxon.event.Sender.send(Sender.java:185)
   at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)


is someone can make me understand why is not working? thanks for read this!
adrian
Posts: 2443

Re: Error transform from xml xsl-fo to pdf

Wed Jun 08, 2011 3:17 pm

Hello,

The XML and XSL files are fine.
I believe you've made a mistake when you configured the FO Processor options in the Oxygen transformation scenario(you're using the input XML as the input for the FO).

To fix this:
Edit the transformation scenario: Document -> Transformation -> Configure Transformation Scenario, Edit. In the FO Processor tab make sure that the Input option is set to XSLT result as input.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
arka
Posts: 6

Re: Error transform from xml xsl-fo to pdf

Wed Jun 08, 2011 4:28 pm

In first thanks you for your answer!
But it still doesn't work...
I tried 2 new scenario (and 3 ways to immplement them because my lack of knowledge :roll: ), in the fo processor i set the input to "XSLT result as input" for both of them.
The first scenario wich i try to implement it to the the xml file give me 1 errors:

Code: Select all

SystemID: C:\Temp\Essaie xml xsl fo\test xml xsl fo\cinema.xml
Description: The process 'FOP' ended with code: 1.
The error was:
8 juin 2011 15:18:17 org.apache.fop.cli.Main startFOP
GRAVE: Exception
net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: file:/C:/Temp/Essaie%20xml%20xsl%20fo/test%20xml%20xsl%20fo/cinema.xml_xslt:1:-1: Error(1/-1): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)

---------

net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: file:/C:/Temp/Essaie%20xml%20xsl%20fo/test%20xml%20xsl%20fo/cinema.xml_xslt:1:-1: Error(1/-1): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+
   at net.sf.saxon.event.ContentHandlerProxy.handleSAXException(ContentHandlerProxy.java:521)
   at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:393)
   at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:213)
   at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:438)
   at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
   at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:371)
   at net.sf.saxon.event.Sender.send(Sender.java:185)
   at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)
Caused by: org.apache.fop.fo.ValidationException: file:/C:/Temp/Essaie%20xml%20xsl%20fo/test%20xml%20xsl%20fo/cinema.xml_xslt:1:-1: Error(1/-1): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+
   at org.apache.fop.fo.FONode.missingChildElementError(FONode.java:425)
   at org.apache.fop.fo.pagination.Flow.endOfNode(Flow.java:90)
   at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:378)
   at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194)
   at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:391)
   ... 19 more
---------
org.apache.fop.fo.ValidationException: file:/C:/Temp/Essaie%20xml%20xsl%20fo/test%20xml%20xsl%20fo/cinema.xml_xslt:1:-1: Error(1/-1): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+
   at org.apache.fop.fo.FONode.missingChildElementError(FONode.java:425)
   at org.apache.fop.fo.pagination.Flow.endOfNode(Flow.java:90)
   at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:378)
   at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194)
   at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:391)
   at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:213)
   at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:438)
   at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
   at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:371)
   at net.sf.saxon.event.Sender.send(Sender.java:185)
   at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)

i also try to implement the first scenario to the project, it give me 2 errors:

Code: Select all

SystemID: C:\Temp\Essaie xml xsl fo\test xml xsl fo\cinema.xml
Description: The process 'FOP' ended with code: 1.
The error was:
8 juin 2011 15:15:25 org.apache.fop.cli.Main startFOP
GRAVE: Exception
net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: file:/C:/Temp/Essaie%20xml%20xsl%20fo/test%20xml%20xsl%20fo/cinema.xml_xslt:1:-1: Error(1/-1): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)

---------

net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: file:/C:/Temp/Essaie%20xml%20xsl%20fo/test%20xml%20xsl%20fo/cinema.xml_xslt:1:-1: Error(1/-1): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+
   at net.sf.saxon.event.ContentHandlerProxy.handleSAXException(ContentHandlerProxy.java:521)
   at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:393)
   at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:213)
   at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:438)
   at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
   at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:371)
   at net.sf.saxon.event.Sender.send(Sender.java:185)
   at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)
Caused by: org.apache.fop.fo.ValidationException: file:/C:/Temp/Essaie%20xml%20xsl%20fo/test%20xml%20xsl%20fo/cinema.xml_xslt:1:-1: Error(1/-1): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+
   at org.apache.fop.fo.FONode.missingChildElementError(FONode.java:425)
   at org.apache.fop.fo.pagination.Flow.endOfNode(Flow.java:90)
   at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:378)
   at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194)
   at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:391)
   ... 19 more
---------
org.apache.fop.fo.ValidationException: file:/C:/Temp/Essaie%20xml%20xsl%20fo/test%20xml%20xsl%20fo/cinema.xml_xslt:1:-1: Error(1/-1): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+
   at org.apache.fop.fo.FONode.missingChildElementError(FONode.java:425)
   at org.apache.fop.fo.pagination.Flow.endOfNode(Flow.java:90)
   at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:378)
   at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194)
   at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:391)
   at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:213)
   at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:438)
   at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
   at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:371)
   at net.sf.saxon.event.Sender.send(Sender.java:185)
   at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)


Code: Select all

SystemID: C:\Temp\Essaie xml xsl fo\test xml xsl fo\cinema1.xsl
Description: The process 'FOP' ended with code: 1.
The error was:
8 juin 2011 15:15:26 org.apache.fop.cli.Main startFOP
GRAVE: Exception
org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: Helvetica
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)

---------

org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: Helvetica
   at org.apache.fop.pdf.PDFFont.validate(PDFFont.java:199)
   at org.apache.fop.pdf.PDFFont.toPDFString(PDFFont.java:210)
   at org.apache.fop.pdf.PDFObject.toPDF(PDFObject.java:176)
   at org.apache.fop.pdf.PDFObject.output(PDFObject.java:165)
   at org.apache.fop.pdf.PDFDocument.output(PDFDocument.java:899)
   at org.apache.fop.pdf.PDFDocument.outputTrailer(PDFDocument.java:972)
   at org.apache.fop.render.pdf.PDFRenderer.stopRenderer(PDFRenderer.java:506)
   at org.apache.fop.area.RenderPagesModel.endDocument(RenderPagesModel.java:245)
   at org.apache.fop.area.AreaTreeHandler.endDocument(AreaTreeHandler.java:283)
   at org.apache.fop.fo.FOTreeBuilder.endDocument(FOTreeBuilder.java:171)
   at net.sf.saxon.event.ContentHandlerProxy.close(ContentHandlerProxy.java:274)
   at net.sf.saxon.event.ProxyReceiver.close(ProxyReceiver.java:90)
   at net.sf.saxon.event.ReceivingContentHandler.endDocument(ReceivingContentHandler.java:218)
   at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
   at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
   at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
   at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:371)
   at net.sf.saxon.event.Sender.send(Sender.java:185)
   at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)


The second scenario wich i try to implement it to the xsl file give me one error:

Code: Select all

SystemID: C:\Temp\Essaie xml xsl fo\test xml xsl fo\cinema1.xsl
Description: The process 'FOP' ended with code: 1.
The error was:
8 juin 2011 15:13:24 org.apache.fop.cli.Main startFOP
GRAVE: Exception
org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: Helvetica
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)

---------

org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: Helvetica
   at org.apache.fop.pdf.PDFFont.validate(PDFFont.java:199)
   at org.apache.fop.pdf.PDFFont.toPDFString(PDFFont.java:210)
   at org.apache.fop.pdf.PDFObject.toPDF(PDFObject.java:176)
   at org.apache.fop.pdf.PDFObject.output(PDFObject.java:165)
   at org.apache.fop.pdf.PDFDocument.output(PDFDocument.java:899)
   at org.apache.fop.pdf.PDFDocument.outputTrailer(PDFDocument.java:972)
   at org.apache.fop.render.pdf.PDFRenderer.stopRenderer(PDFRenderer.java:506)
   at org.apache.fop.area.RenderPagesModel.endDocument(RenderPagesModel.java:245)
   at org.apache.fop.area.AreaTreeHandler.endDocument(AreaTreeHandler.java:283)
   at org.apache.fop.fo.FOTreeBuilder.endDocument(FOTreeBuilder.java:171)
   at net.sf.saxon.event.ContentHandlerProxy.close(ContentHandlerProxy.java:274)
   at net.sf.saxon.event.ProxyReceiver.close(ProxyReceiver.java:90)
   at net.sf.saxon.event.ReceivingContentHandler.endDocument(ReceivingContentHandler.java:218)
   at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
   at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
   at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
   at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:371)
   at net.sf.saxon.event.Sender.send(Sender.java:185)
   at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)

What do you think i have to do to make it work?
Thanks for your help!
arka
Posts: 6

Re: Error transform from xml xsl-fo to pdf

Wed Jun 08, 2011 4:29 pm

arka wrote:In first thanks you for your answer!
But it still doesn't work...
I tried 2 new scenario (and 3 ways to immplement them because of my of lack of knowledge :roll: ), in the fo processor i set the input to "XSLT result as input" for both of them.
The first scenario wich i try to implement it to the the xml file give me 1 errors:

Code: Select all

SystemID: C:\Temp\Essaie xml xsl fo\test xml xsl fo\cinema.xml
Description: The process 'FOP' ended with code: 1.
The error was:
8 juin 2011 15:18:17 org.apache.fop.cli.Main startFOP
GRAVE: Exception
net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: file:/C:/Temp/Essaie%20xml%20xsl%20fo/test%20xml%20xsl%20fo/cinema.xml_xslt:1:-1: Error(1/-1): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)

---------

net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: file:/C:/Temp/Essaie%20xml%20xsl%20fo/test%20xml%20xsl%20fo/cinema.xml_xslt:1:-1: Error(1/-1): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+
   at net.sf.saxon.event.ContentHandlerProxy.handleSAXException(ContentHandlerProxy.java:521)
   at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:393)
   at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:213)
   at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:438)
   at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
   at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:371)
   at net.sf.saxon.event.Sender.send(Sender.java:185)
   at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)
Caused by: org.apache.fop.fo.ValidationException: file:/C:/Temp/Essaie%20xml%20xsl%20fo/test%20xml%20xsl%20fo/cinema.xml_xslt:1:-1: Error(1/-1): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+
   at org.apache.fop.fo.FONode.missingChildElementError(FONode.java:425)
   at org.apache.fop.fo.pagination.Flow.endOfNode(Flow.java:90)
   at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:378)
   at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194)
   at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:391)
   ... 19 more
---------
org.apache.fop.fo.ValidationException: file:/C:/Temp/Essaie%20xml%20xsl%20fo/test%20xml%20xsl%20fo/cinema.xml_xslt:1:-1: Error(1/-1): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+
   at org.apache.fop.fo.FONode.missingChildElementError(FONode.java:425)
   at org.apache.fop.fo.pagination.Flow.endOfNode(Flow.java:90)
   at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:378)
   at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194)
   at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:391)
   at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:213)
   at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:438)
   at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
   at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:371)
   at net.sf.saxon.event.Sender.send(Sender.java:185)
   at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)

i also try to implement the first scenario to the project, it give me 2 errors:

Code: Select all

SystemID: C:\Temp\Essaie xml xsl fo\test xml xsl fo\cinema.xml
Description: The process 'FOP' ended with code: 1.
The error was:
8 juin 2011 15:15:25 org.apache.fop.cli.Main startFOP
GRAVE: Exception
net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: file:/C:/Temp/Essaie%20xml%20xsl%20fo/test%20xml%20xsl%20fo/cinema.xml_xslt:1:-1: Error(1/-1): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)

---------

net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: file:/C:/Temp/Essaie%20xml%20xsl%20fo/test%20xml%20xsl%20fo/cinema.xml_xslt:1:-1: Error(1/-1): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+
   at net.sf.saxon.event.ContentHandlerProxy.handleSAXException(ContentHandlerProxy.java:521)
   at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:393)
   at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:213)
   at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:438)
   at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
   at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:371)
   at net.sf.saxon.event.Sender.send(Sender.java:185)
   at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)
Caused by: org.apache.fop.fo.ValidationException: file:/C:/Temp/Essaie%20xml%20xsl%20fo/test%20xml%20xsl%20fo/cinema.xml_xslt:1:-1: Error(1/-1): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+
   at org.apache.fop.fo.FONode.missingChildElementError(FONode.java:425)
   at org.apache.fop.fo.pagination.Flow.endOfNode(Flow.java:90)
   at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:378)
   at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194)
   at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:391)
   ... 19 more
---------
org.apache.fop.fo.ValidationException: file:/C:/Temp/Essaie%20xml%20xsl%20fo/test%20xml%20xsl%20fo/cinema.xml_xslt:1:-1: Error(1/-1): fo:flow is missing child elements.
Required Content Model: marker* (%block;)+
   at org.apache.fop.fo.FONode.missingChildElementError(FONode.java:425)
   at org.apache.fop.fo.pagination.Flow.endOfNode(Flow.java:90)
   at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:378)
   at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194)
   at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:391)
   at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:213)
   at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:438)
   at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
   at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:371)
   at net.sf.saxon.event.Sender.send(Sender.java:185)
   at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)


Code: Select all

SystemID: C:\Temp\Essaie xml xsl fo\test xml xsl fo\cinema1.xsl
Description: The process 'FOP' ended with code: 1.
The error was:
8 juin 2011 15:15:26 org.apache.fop.cli.Main startFOP
GRAVE: Exception
org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: Helvetica
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)

---------

org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: Helvetica
   at org.apache.fop.pdf.PDFFont.validate(PDFFont.java:199)
   at org.apache.fop.pdf.PDFFont.toPDFString(PDFFont.java:210)
   at org.apache.fop.pdf.PDFObject.toPDF(PDFObject.java:176)
   at org.apache.fop.pdf.PDFObject.output(PDFObject.java:165)
   at org.apache.fop.pdf.PDFDocument.output(PDFDocument.java:899)
   at org.apache.fop.pdf.PDFDocument.outputTrailer(PDFDocument.java:972)
   at org.apache.fop.render.pdf.PDFRenderer.stopRenderer(PDFRenderer.java:506)
   at org.apache.fop.area.RenderPagesModel.endDocument(RenderPagesModel.java:245)
   at org.apache.fop.area.AreaTreeHandler.endDocument(AreaTreeHandler.java:283)
   at org.apache.fop.fo.FOTreeBuilder.endDocument(FOTreeBuilder.java:171)
   at net.sf.saxon.event.ContentHandlerProxy.close(ContentHandlerProxy.java:274)
   at net.sf.saxon.event.ProxyReceiver.close(ProxyReceiver.java:90)
   at net.sf.saxon.event.ReceivingContentHandler.endDocument(ReceivingContentHandler.java:218)
   at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
   at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
   at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
   at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:371)
   at net.sf.saxon.event.Sender.send(Sender.java:185)
   at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)


The second scenario wich i try to implement it to the xsl file give me one error:

Code: Select all

SystemID: C:\Temp\Essaie xml xsl fo\test xml xsl fo\cinema1.xsl
Description: The process 'FOP' ended with code: 1.
The error was:
8 juin 2011 15:13:24 org.apache.fop.cli.Main startFOP
GRAVE: Exception
org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: Helvetica
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)

---------

org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: Helvetica
   at org.apache.fop.pdf.PDFFont.validate(PDFFont.java:199)
   at org.apache.fop.pdf.PDFFont.toPDFString(PDFFont.java:210)
   at org.apache.fop.pdf.PDFObject.toPDF(PDFObject.java:176)
   at org.apache.fop.pdf.PDFObject.output(PDFObject.java:165)
   at org.apache.fop.pdf.PDFDocument.output(PDFDocument.java:899)
   at org.apache.fop.pdf.PDFDocument.outputTrailer(PDFDocument.java:972)
   at org.apache.fop.render.pdf.PDFRenderer.stopRenderer(PDFRenderer.java:506)
   at org.apache.fop.area.RenderPagesModel.endDocument(RenderPagesModel.java:245)
   at org.apache.fop.area.AreaTreeHandler.endDocument(AreaTreeHandler.java:283)
   at org.apache.fop.fo.FOTreeBuilder.endDocument(FOTreeBuilder.java:171)
   at net.sf.saxon.event.ContentHandlerProxy.close(ContentHandlerProxy.java:274)
   at net.sf.saxon.event.ProxyReceiver.close(ProxyReceiver.java:90)
   at net.sf.saxon.event.ReceivingContentHandler.endDocument(ReceivingContentHandler.java:218)
   at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
   at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
   at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
   at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:371)
   at net.sf.saxon.event.Sender.send(Sender.java:185)
   at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
   at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
   at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
   at org.apache.fop.cli.Main.startFOP(Main.java:166)
   at org.apache.fop.cli.Main.main(Main.java:197)

What do you think i have to do to make it work?
Thanks for your help!
adrian
Posts: 2443

Re: Error transform from xml xsl-fo to pdf

Wed Jun 08, 2011 4:52 pm

What version of Oxygen are you using(Help -> About)?
On what platform are you running Oxygen(Windows, Mac, Linux)?

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
arka
Posts: 6

Re: Error transform from xml xsl-fo to pdf

Wed Jun 08, 2011 5:12 pm

i am using this version on windows XP:
<oXygen/> XML Editor 9.3, build 2008081313
adrian
Posts: 2443

Re: Error transform from xml xsl-fo to pdf

Wed Jun 08, 2011 5:36 pm

Assuming you haven't modified the XSL or the XML from your original post it should work correctly.

Follow these instructions to create a correct transformation scenario in Oxygen:
1. Open in Oxygen both the XML and XSl file and select the XML file as your current editor.
2. Create a new transformation scenario: Document -> Transformation -> Configure Transformation Scenario, New.
3. In the XML URL field leave the default value: ${currentFileURL}
4. In the XSL URL field choose the XSL file(you should find it in the combo).
5. Make sure the Transformer is Saxon6.5.5.
6. In the FO Processor tab enable the option Perform FO Processing and make sure that the Input option is set to XSLT result as input.
7. In the Output tab, in the Save As field use: ${cfd}/${cfn}.pdf
8. In the Output tab enable the Open in browser option if you want the PDF to be opened in the browser(or system application).
9. Press OK and Transform now.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
arka
Posts: 6

Re: Error transform from xml xsl-fo to pdf

Wed Jun 08, 2011 5:55 pm

I didn't modified the files and i did everything you said... it's weird. :?
whatever, my day is over i'll talk to my internship mentor tomorow maybe i'll learn more to say to you! Sorry if my english is not good and thanks you again Adrian!
adrian
Posts: 2443

Re: Error transform from xml xsl-fo to pdf

Thu Jun 09, 2011 10:22 am

Hi,

It seems the problem is caused by Apache FOP when generating PDF/A-1b output in some configurations.
To resolve this, go to Options -> Preferences -> XML -> XSLT-FO-XQuery -> FO Processors and clear the option "The built-in FOP generates PDF/A-1b output".

Now it should work with the second scenario, the one that returned:

Code: Select all

GRAVE: Exception
org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: Helvetica


Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
arka
Posts: 6

Re: Error transform from xml xsl-fo to pdf

Thu Jun 09, 2011 11:09 am

It works perfectly,Well done Adrian!
Thanks you! :D

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 0 guests