[ https://issues.apache.org/jira/browse/XALANJ-2385?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joe Kesselman updated XALANJ-2385: ---------------------------------- Priority: Trivial (was: Blocker) > hi need a great help please post me :) > -------------------------------------- > > Key: XALANJ-2385 > URL: https://issues.apache.org/jira/browse/XALANJ-2385 > Project: XalanJ2 > Issue Type: Wish > Components: Xalan > Affects Versions: 2.7 > Environment: Unix > Solaris > Reporter: mirko > Priority: Trivial > > 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 was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org For additional commands, e-mail: dev-h...@xalan.apache.org