hi need a great help please post me :) --------------------------------------
Key: XALANJ-2385 URL: https://issues.apache.org/jira/browse/XALANJ-2385 Project: XalanJ2 Issue Type: Improvement Affects Versions: 2.0.2 Environment: Unix Solaris Reporter: mirko Priority: Critical Good morning i have 1 great problem whit stykesheet. I trasmormed 1 xsl in 1 class java whit xalan and now i need use this class in other my class for create 1 fop Document. Not found what class i need and what source i need use for this implementation. Any one write in this post a little code to example me? my code in this moment is this!!! ehre i modified my code for use a class and not a file? pls help not understend where is the point and class tanks File xmlfile = new File("webapps"+req.getContextPath()+fileSeparator+"data"+fileSeparator,xmlNames[0]); File xsltfile = new File("webapps"+req.getContextPath()+fileSeparator+"xslfo"+fileSeparator,xsltNames[0]); String baseUrl = "http://"+req.getServerName()+req.getContextPath()+fileSeparator+"xslfo"; // setup canale uscita ByteArrayOutputStream outi = new ByteArrayOutputStream(); try { // configurare fopFactory FopFactory fopFactory = FopFactory.newInstance(); DefaultConfigurationBuilder build = new DefaultConfigurationBuilder(); Configuration config = build.buildFromFile(new File("/usr/local/fop/conf/fopConfig.xml")); fopFactory.setUserConfig(config); // configurare foUserAgent FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); foUserAgent.setBaseURL(baseUrl); // carichiamo la fop Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, outi); // carichiamo il file di conversione xslt TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(new StreamSource(xsltfile)); // valori nello stylesheet transformer.setParameter("versionParam", "2.0"); // carichiamo i dati del file Source src = new StreamSource(xmlfile); // creiamo l'oggetto sax utilizzato per la conversione con i parametri definiti dal fop per acrobat Result res = new SAXResult(fop.getDefaultHandler()); // converto i dati transformer.transform(src, res); } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]