Hi Oscar, I can't really tell what the problem might be.But it looks like it's a problem with the xml file.
One thing I see in your file is: you use a ' instead of " on the tag <?xml version = '1.0'?>. Try with <?xml version = "1.0"?> maybe that's it. Cheers, ______________________________________________________________ Hugo L�rias Solution Architect Akamai Technologies GmbH Mail: [EMAIL PROTECTED] Succeed with Akamai EdgeComputing: http://www.akamai.com/en/html/services/edgecomputing.html ________________________________________________________________ About Akamai Akamai provides products and services that enable the world's leading enterprises and government agencies to extend and control their e-business infrastructure. Having deployed the world's largest, globally-distributed computing platform, Akamai ensures the highest levels of availability, reliability, security, and performance of networked information and applications delivery between the origin and the destination of any e-business process. Headquartered in Cambridge, Massachusetts, with research and development centers around the world, Akamai's industry-leading products and services, matched with world-class customer care, are used by hundreds of successful enterprises, government entities, and Web businesses around the globe. For more information, visit www.akamai.com. ________________________________________________________________ -----Original Message----- From: "Crist�bal Ruiz, Oscar" [mailto:[EMAIL PROTECTED] Sent: Montag, 29. Dezember 2003 12:11 To: [EMAIL PROTECTED] Subject: How to use XSL-FOP-Java together Hi there. I dont get to tranform directly from XML to a PDF file. I tried to execute the simplest example... but I cannot do it. I get this exception: Content is not allowed in prolog. What is the meaning of that? Thanks in advance. My xsl file is: ******************************************* <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:output indent="yes"/> <xsl:template match="/"> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="only"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="only"> <fo:flow flow-name="xsl-region-body"> <xsl:apply-templates select="//ATOM"/> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> <xsl:template match="ATOM"> <fo:block font-size="20pt" font-family="serif" line-height="30pt"> <xsl:value-of select="NAME"/> </fo:block> </xsl:template> </xsl:stylesheet> ******************************************* My xml file is: ******************************************* <?xml version = '1.0'?> <ATOM> <NAME> Plata </NAME> </ATOM> ******************************************* I receive the next stack trace: ******************************** javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: Content is not allowed in prolog. at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java: 686) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java: 1088) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java: 1066) at reporte.processor.Procesador.XML2PDF(Procesador.java:132) at reporte.Marco1.jButton1_actionPerformed(Marco1.java:83) at reporte.Marco1_jButton1_actionAdapter.actionPerformed(Marco1.java:124) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764) at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButto n.java:1817) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:4 19) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener .java:245) at java.awt.Component.processMouseEvent(Component.java:5134) at java.awt.Component.processEvent(Component.java:4931) at java.awt.Container.processEvent(Container.java:1566) at java.awt.Component.dispatchEventImpl(Component.java:3639) at java.awt.Container.dispatchEventImpl(Container.java:1623) at java.awt.Component.dispatchEvent(Component.java:3480) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095) at java.awt.Container.dispatchEventImpl(Container.java:1609) at java.awt.Window.dispatchEventImpl(Window.java:1590) at java.awt.Component.dispatchEvent(Component.java:3480) at java.awt.EventQueue.dispatchEvent(EventQueue.java:450) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja va:197) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java :150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136) at java.awt.EventDispatchThread.run(EventDispatchThread.java:99) Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog. at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xml.dtm.ref.DTMManagerDefault.getDTM(DTMManagerDefault.java:349) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java: 630) ... 28 more --------- org.xml.sax.SAXParseException: Content is not allowed in prolog. at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xml.dtm.ref.DTMManagerDefault.getDTM(DTMManagerDefault.java:349) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java: 630) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java: 1088) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java: 1066) at reporte.processor.Procesador.XML2PDF(Procesador.java:132) at reporte.Marco1.jButton1_actionPerformed(Marco1.java:83) at reporte.Marco1_jButton1_actionAdapter.actionPerformed(Marco1.java:124) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764) at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButto n.java:1817) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:4 19) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener .java:245) at java.awt.Component.processMouseEvent(Component.java:5134) at java.awt.Component.processEvent(Component.java:4931) at java.awt.Container.processEvent(Container.java:1566) at java.awt.Component.dispatchEventImpl(Component.java:3639) at java.awt.Container.dispatchEventImpl(Container.java:1623) at java.awt.Component.dispatchEvent(Component.java:3480) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095) at java.awt.Container.dispatchEventImpl(Container.java:1609) at java.awt.Window.dispatchEventImpl(Window.java:1590) at java.awt.Component.dispatchEvent(Component.java:3480) at java.awt.EventQueue.dispatchEvent(EventQueue.java:450) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja va:197) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java :150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136) at java.awt.EventDispatchThread.run(EventDispatchThread.java:99) ******************************** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
