Let me add to that that executing that code creates a file called BigXMLComponentDefault.class that is 17kb. However, getByteCodes still doesn't give me those. How can I prevent that file from being written and how can I get the byte code ?
Ed. -----Original Message----- From: Erik Dasque [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2001 9:20 AM To: [EMAIL PROTECTED] Subject: Using org.apache.xalan.xsltc.compiler.XSLTC Hi all, I am trying to use org.apache.xalan.xsltc.compiler.XSLTC in a class loader or servlet and my code looks like this : XSLTC myXSLTCompiler = new XSLTC(); myXSLTCompiler.init(); // myXSLTCompiler.setClassName(); // myXSLTCompiler.setPackageName("what.could.I.put.here"); long end = 1L; long start = 0L; myXSLTCompiler.setDebug(true); start = System.currentTimeMillis(); System.out.println("Compilation :"+myXSLTCompiler.compile (new java.net.URL("http://localhost/Director/Olive/ResourceSet/resource/portal-st yle/BigXMLComponentDefault.xsl"))); end = System.currentTimeMillis(); System.out.println("Time to compile the Translet : "+(end-start)+"ms"); sb.append("Class Name:<b>"+myXSLTCompiler.getClassName() +"</b><br>"); sb.append("Errors:<pre>"+myXSLTCompiler.getErrors()+"</pre><br>"); sb.append("Warnings:<pre>"+myXSLTCompiler.getWarnings()+"</pre><br>"); myXSLTCompiler.printErrors(); myXSLTCompiler.printWarnings(); System.out.println("Getting ByteCodes"); byte[][] myBuff = myXSLTCompiler.getBytecodes(); System.out.println("the buffer.length: "+myBuff.length); I get the following outputs : Time to compile the Translet : 130ms Class Name:BigXMLComponentDefault Errors:[] Warnings:[] but the following exception as myXSLTCompiler.getBytecodes() returns an empty byte array. I can compile this stylesheet using the command-line but there must be something I am doing wrong here. What do you think ? Ed. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
