Hi J.Pietschmann, You pointed me into the right path! I´m now solved my problems with the parser.. altough now I get a brand new error...
javax.xml.transform.TransformerConfigurationException: stylesheet requires attribute: version at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(Transformer FactoryImpl.java:650) I´ve been digging thru the docs and seems like my xsl namespace is wrong.. so i´ve found this two possible namespaces defitnitions.. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> wich one is right?... i seem to get the error anyway with both namespaces... =( Best Regards, Esteban ----- Original Message ----- From: "J.Pietschmann" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 29, 2002 8:54 PM Subject: Re: Embedding.... newbie problem.... > Esteban Gonzalez wrote: > > Hi! > > I´ve been trying to do some xml --> pdf transformation using FOP. > > When I run FOP manually everything is wonderful, but i don´t seem to really > > understand how to embeed it in a running app. > > The problem is with the input Source .. > > I have both the xml file and the xsl file as org.w3c.dom.Document and I > > don´t seem to be able to use them as input for the transformation. > > I´ll post a code snippet to make myself clear > > <code> > ... > > Driver driver = new Driver(); > > driver.setRenderer( Driver.RENDER_PDF ); > > driver.setInputSource( new DocumentInputSource( xsl ) ); > > This won't work. THe driver expects a FO document at this > point, no XSLT. > > > (http://xml.apache.org/fop/embedding.html), the problem is.. I seem to be > > setting an XSL file as an input... so where do I set the XML Document as an > > input? > > You need an XSLT transformer. > Something like this: > > Driver driver =new Driver(); > driver.setOutputStream(response.getOutputStream()); > driver.setRenderer(Driver.RENDER_PDF); > Transformer transformer=TransformerFactory.newInstance() > .newTransformer(new DOMSource(xsl)); > transformer.transform(new DOMSource(xml), > new SAXResult(driver.getContentHandler())); > > Check the package javax.xml.transform and subpackages. > > J.Pietschmann > > > > > I´ve been digging thru the fop api and found out this class XSLTransform > > wich seems to take an XLM doc, and a XSL file as inputs and outputs a > > org.w3c.dom.Document, but again.. I can´t input the XSL as a document... > > > > there are any workarounds to this problems?... > > or maybe some ideas? > > > > Thanks for all your help! > > > > Best Regards, > > Esteban González > > > > ---------------------------------- > > Esteban González > > > > Departamento de Sistemas > > ASSIST-CARD International > > > > > > >