Hi!
I´ve tried dumping the xsl DOM that xml.getXSL() returned..
this is the header
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl"
href="c:\enhydra\xml1\assistcard\com\icard\xml\voucher.xsl"?>
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="vouchers">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
Still.. I´m getting the error
javax.xml.transform.TransformerException: stylesheet requires attribute:
version
; SystemID: file://///javax.xml.transform.dom.DOMSource
; SystemID: file://///javax.xml.transform.dom.DOMSource
I´m running out of ideas.
I think it might be a problem with SAX or DOM?
this is my classpath
wrapper.classpath=/opt/fop-0.20.3/build/fop.jar
wrapper.classpath=/opt/fop-0.20.3/lib/logkit-1.0.jar
wrapper.classpath=/opt/fop-0.20.3/lib/avalon-framework-4.0.jar
wrapper.classpath=/opt/fop-0.20.3/lib/batik.jar
wrapper.classpath=/opt/fop-0.20.3/lib/tools.jar
wrapper.classpath=/opt/fop-0.20.3/lib/xalan-2.0.0.jar
wrapper.classpath=/opt/fop-0.20.3/lib/jpda.jar
wrapper.classpath=/opt/fop-0.20.3/lib/xalan-2.0.0.jar
wrapper.classpath=/opt/fop-0.20.3/lib/xalanj1compat.jar
wrapper.classpath=/opt/fop-0.20.3/lib/xerces-1.2.3.jar
wrapper.classpath=/opt/fop-0.20.3/lib/jimi-1.0.jar
#wrapper.classpath=/opt/xerces2.0/xercesImpl.jar
#wrapper.classpath=/opt/xerces2.0/xmlParserAPIs.jar
There´s anything wrong there?
----- Original Message -----
From: "J.Pietschmann" <j3322ptm@yahoo.de>
To: <fop-user@xml.apache.org>
Sent: Friday, May 31, 2002 5:48 PM
Subject: Re: wrong namespace??
> Esteban Gonzalez wrote:
> > seems like an error in the code?
> >
> > // ADDED XML VOUCHER GENERATION
> > XMLGenerator xml = new XMLGenerator();
> > Document voucher = xml.generateVoucher( voucherGener );
> > Document xsl = xml.getXSL();
> >
> > // XSL Formatting.
> > Driver driver = new Driver();
> > driver.setRenderer( Driver.RENDER_PDF );
> > file://driver.setInputSource( new
DocumentInputSource() );
> > driver.setOutputStream( outStream );
> >
> > file://Let's set the input
> > Transformer trans =
> > TransformerFactory.newInstance().newTransformer( new DOMSource( xsl ) );
> > trans.transform( new DOMSource( voucher ), new
> > AXResult( driver.getContentHandler() ));
>
> This is already driving the formatting, everything from here
> won't have any effect.
>
> > file://Let's set all loggin stuff
> > Logger log = null;
> > Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
> > PatternFormatter formatter = new
> > PatternFormatter("[%{priority}]: %{message}\n%{throwable}");
> > LogTarget target = null;
> > target = new StreamTarget(System.err, formatter);
> > hierarchy.setDefaultLogTarget(target);
> > log = hierarchy.getLoggerFor("fop");
> > log.setPriority(Priority.DEBUG);
> > driver.setLogger(log);
> >
> > file://Let's try another thing
> > file://XSLTInputHandler input = new XSLTInputHandler(new
> > File(xmlParam), new File(xslParam));
> >
> > file://Let's render the Formatting tree
> > driver.render( voucher );
>
> This is particularly superflous, as the document has already been
> rendered.
>
> Are you sure this:
> > Document xsl = xml.getXSL();
> gets you the correct DOM for the style sheet? Try dumping it
> to a file using the identity transformer:
> TransformerFactory.newInstance().newTransformer().transform(
> new DOMSource(xsl), new StreamResult(new File("dump.xsl")));
>
> BTW Unless you have to manipulate the content, use SAX instead
> of DOM whereever feasible.
>
> J.Pietschmann
>
|