If I use XBootClassPath I am not getting error
java -Xbootclasspath/p:c:\jars\xsltc.jar XSLCompiler1 >err.txt
or some times I am getting this error
Exception: java.lang.IllegalAccessError: class
org.apache.xml.dtm.ref.sax2dtm.SAX2DTM2$AncestorIterator cannot access
its superclass
org.apache.xml.dtm.ref.DTMDefaultBaseIterators$InternalAxisIteratorBase
java.lang.IllegalAccessError: class
org.apache.xml.dtm.ref.sax2dtm.SAX2DTM2$AncestorIterator cannot access
its superclass
org.apache.xml.dtm.ref.DTMDefaultBaseIterators$InternalAxisIteratorBase
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at
org.apache.xalan.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:351)
at
org.apache.xalan.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:228)
at
org.apache.xalan.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:437)
at
org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:597)
at
org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:277)
at XSLCompiler1.transform(XSLCompiler1.java:73)
at XSLCompiler1.main(XSLCompiler1.java:13)
On Mon, 14 Mar 2005 00:19:48 +0530, IndianAtTech <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I am facing the problem while compiling xsl file using Translets.
>
> When I compile it using Transformers I haven't faced any problem. But
> I don't know why I am facing the problem using Translets. I tried to
> find the solution for this problem on google. But most of the guys
> are getting the same problem, but it seems they doesn't get the
> solution for this.
>
> I included both the developers and users group because, I am expecting
> a postive revert from the developers as they know the root cause for
> this exception
>
> I am also includong Source code for which I am getting exceptions
>
> import java.io.* ;
> import javax.xml.transform.* ;
> import javax.xml.transform.stream.* ;
>
> public class XSLCompiler
> {
>
> public static void main ( String[] args )
> throws Exception
> {
> XSLCompiler app = new XSLCompiler () ;
> app.transform ( "c:/eml.xsl") ;
> }
>
> /**
> * Compiles an XSL stylesheet into a translet, wraps tshe translet
> * inside a Templates object and dumps it to a file.
> */
> public Transformer getTransformer ( String xsl ) throws Exception
> {
> try
> {
> // Set XSLTC's TransformerFactory implementation as the default
> System.setProperty ( "javax.xml.transform.TransformerFactory" ,
>
> "org.apache.xalan.xsltc.trax.TransformerFactoryImpl" ) ;
>
> // Get an input stream for the XSL stylesheet
> StreamSource stylesheet = new StreamSource ( xsl ) ;
>
> // The TransformerFactory will compile the stylesheet and
> // put the translet classes inside the Templates object
> TransformerFactory factory = TransformerFactory.newInstance () ;
> factory.setAttribute ( "generate-translet" , Boolean.TRUE ) ;
> Templates templates = factory.newTemplates ( stylesheet ) ;
> Transformer transformer = templates.newTransformer () ;
> return transformer ;
> }
> catch ( Exception e )
> {
> System.err.println ( "Exception: " + e ) ;
> e.printStackTrace () ;
> throw new Exception("Error ",e);
> }
>
> }
>
> public void transform ( String xslFileName )
> throws Exception
> {
> Transformer transformer = getTransformer ( xslFileName ) ;
> if ( transformer == null )
> {
>
> throw new RuntimeException ( "Bad XSL File or transformer
> creation problem" ) ;
> }
> ByteArrayOutputStream transformmedStream = new
> ByteArrayOutputStream () ;
> FileInputStream fin = new FileInputStream ( "c:/111.xml" ) ;
> transformer.transform ( new StreamSource ( fin ) , new
> StreamResult ( transformmedStream ) ) ;
> System.err.println(transformmedStream.toString());
> }
>
> private void usage ()
> {
> System.err.println ( "Usage: XSLCompiler <xsl_file>" ) ;
> System.exit ( 1 ) ;
> }
>
> }
>
> Thanks
> Sudhakar
>
> ERROR: 'org.apache.xml.utils.XMLChar.isValidQName(Ljava/lang/String;)Z'
> FATAL ERROR: 'Could not compile stylesheet'
> Exception: javax.xml.transform.TransformerConfigurationException:
> Could not compile stylesheet
> javax.xml.transform.TransformerConfigurationException: Could not
> compile stylesheet
> at
> org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:753)
> at XSLCompiler.getTransformer(XSLCompiler.java:47)
> at XSLCompiler.transform(XSLCompiler.java:63)
> at XSLCompiler.main(XSLCompiler.java:25)
> java.lang.Exception: Error
> at XSLCompiler.getTransformer(XSLCompiler.java:55)
> at XSLCompiler.transform(XSLCompiler.java:63)
> at XSLCompiler.main(XSLCompiler.java:25)
> Caused by: javax.xml.transform.TransformerConfigurationException:
> Could not compile stylesheet
> at
> org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:753)
> at XSLCompiler.getTransformer(XSLCompiler.java:47)
> ... 2 more
> Exception in thread "main"
>
>
>