You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Erik Dasque <ed...@silverstream.com> on 2001/11/02 00:52:42 UTC

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));

      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 : 130
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: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org