Hi again,

Just to make sure I wasn't talking through my hat, I tried out what I
told you to do. It works OK for me. I attached a short java file
(TestXSLT) which I tested with your xml and xsl. Here is what I used to
run it (TestXSLT.class in the local directory).

java -cp
.:build/fop.jar:lib/xerces-1.2.3.jar:lib/xalan-2.0.0.jar:lib/batik.jar
TestXSLT prueba.xml prueba.xsl

It looks like you had all the pieces, but maybe not in the right order.

If it works, I'll collect the beer next time I'm in Geneva (unless
you're in Paris (France, not Texas!) before then.

Salut,
Karen

"Wolf Gustavo (SGC-EXT)" wrote:
> 
> Hi Erik,
>          I have tried your stuff, but it still gives me the same problem i
> have since two days after I try to instantiate the parser:
> 
> javax.xml.transform.TransformerConfigurationException: Namespace not
> supported by SAXParser
> Error msg: null
> 
> At the risk of looking abusive, could someone take a look at the xml and xsl
> files (they are really short examples that work with Fop as a line command,
> and I'll invite a beer to whomever comes to Geneva (CH, not IL) to pick it
> up)?
>
import java.io.File;

import org.apache.fop.apps.InputHandler;
import org.apache.fop.apps.XSLTInputHandler;
import org.apache.fop.apps.Driver;

// SAX
import org.xml.sax.XMLReader;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

public class    TestXSLT {

    public static void main(String args[]) {
        if (args.length != 2) {
            System.err.println("Usage: TestXSLT xmlfile xslfile");
            System.exit(1);
        }
        try {
        File xmlInputSource = new File(args[0]);
        File xslInputSource = new File(args[1]);
        InputHandler inputHandler = new
            XSLTInputHandler(xmlInputSource,xslInputSource);
        XMLReader parser = inputHandler.getParser();
        parser.setFeature("http://xml.org/sax/features/namespace-prefixes";,
                          true);
 
/**
* Creates the driver telling it to write the output to a file.
*/
        Driver driver = new Driver();
        driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer");
//  ERROR IN THE FOLLOWING LINE
        driver.buildFOTree(parser,inputHandler.getInputSource());
        File test = new File("test.pdf");
        driver.setOutputStream(new java.io.FileOutputStream(test));
        driver.format();
        driver.render();
        }
        catch (Exception e) {
            System.err.println("Caught exception: " + e);
            e.printStackTrace();
        }
    }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to