You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by IndianAtTech <in...@gmail.com> on 2005/03/13 19:49:48 UTC
Exception raised while compiling the XSL file using Translets
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"
Re: Exception raised while compiling the XSL file using Translets
Posted by Brian Minchau <mi...@ca.ibm.com>.
Sudhakar,
please open an issue regarding
Exception raised while compiling the XSL file using Translets
to track this in the JIRA tracking system at:
http://issues.apache.org/jira/
The component to use there is XalanJ2. You may need to create an account to
be able to create a new issue. Creating an account doesn't need much more
than a valid e-mail account, so that you can get notified about
changes/comments/etc. to that issue.
It is better if all the correspondence on this potential bug is together in
one issue in JIRA rather than spread across notes on the mailing lists.
Right now I'm thinking that this is a classpath issue, see the Xalan FAQ:
http://xml.apache.org/xalan-j/faq.html#faq-N100CC
- Brian
- - - - - - - - - - - - - - - - - - - -
Brian Minchau
XSLT Development, IBM Toronto
e-mail: minchau@ca.ibm.com
Exception raised while compiling the XSL file using Translets
Posted by IndianAtTech <in...@gmail.com>.
Hi All
I am not understanding how to overcome with this issue
If I execute directly I am getting exception.
If I execute using xBootClassPath params say something like java
-Xbootclasspath/p:c:\jars\xsltc.jar then I am not getting exception.
Basically I don't want to use xBootClassPath.
I know instead of depending on Translets I can directly use XALAn API.
But our client team insisting on translets only and they don't want to
set the xBootClasspath param while executing application.
Basically the problem is with below lines
System.setProperty ( "javax.xml.transform.TransformerFactory" ,
"org.apache.xalan.xsltc.trax.TransformerFactoryImpl" ) ;
TransformerFactory factory = TransformerFactory.newInstance () ;
Templates templates = factory.newTemplates ( stylesheet ) ;
I need to set the Transformer Factory Implementation class (i.e
org.apache.xalan.xsltc.trax.TransformerFactoryImpl which is from Trax
API) so that I can get the results.
But it seems before setting the System property, JRE's class loader is
loading the default implementation class i.e is from xalan API
And also we have same interface for both XALAN api and JAXP
TransformerFactory
http://xml.apache.org/xalan-j/apidocs/javax/xml/transform/TransformerFactory.html
http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/TransformerFactory.html
I thought, if I use XALAN's class instead of JAXP's class I can get
rid of this error.
For this I need to have a custom class loader.I tried to write the
Custom class loader. But I have failed in implementing so :-(
Plz help me resolve this issue.
Source code :
import java.io.* ;
import javax.xml.transform.* ;
import javax.xml.transform.stream.* ;
public class XSLCompiler1
{
public static void main ( String[] args )
throws Exception
{
try{
XSLCompiler1 app = new XSLCompiler1 () ;
app.transform ( "c:/eml.xsl") ;
}
catch(Throwable e)
{
System.out.println ( "Exception: " + e ) ;
StringWriter sw=new StringWriter();
PrintWriter pw=new PrintWriter(sw);
e.printStackTrace (pw) ;
System.out.println(sw);
}
}
/**
* 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.out.println ( "Exception: " + e ) ;
StringWriter sw=new StringWriter();
PrintWriter pw=new PrintWriter(sw);
e.printStackTrace (pw) ;
System.out.println(sw);
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.out.println(transformmedStream.toString());
}
private void usage ()
{
System.out.println ( "Usage: XSLCompiler1 <xsl_file>" ) ;
System.exit ( 1 ) ;
}
}
Exception Stack Trace :
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)
Exception raised while compiling the XSL file using Translets
Posted by IndianAtTech <in...@gmail.com>.
Hi All
I am not understanding how to overcome with this issue
If I execute directly I am getting exception.
If I execute using xBootClassPath params say something like java
-Xbootclasspath/p:c:\jars\xsltc.jar then I am not getting exception.
Basically I don't want to use xBootClassPath.
I know instead of depending on Translets I can directly use XALAn API.
But our client team insisting on translets only and they don't want to
set the xBootClasspath param while executing application.
Basically the problem is with below lines
System.setProperty ( "javax.xml.transform.TransformerFactory" ,
"org.apache.xalan.xsltc.trax.TransformerFactoryImpl" ) ;
TransformerFactory factory = TransformerFactory.newInstance () ;
Templates templates = factory.newTemplates ( stylesheet ) ;
I need to set the Transformer Factory Implementation class (i.e
org.apache.xalan.xsltc.trax.TransformerFactoryImpl which is from Trax
API) so that I can get the results.
But it seems before setting the System property, JRE's class loader is
loading the default implementation class i.e is from xalan API
And also we have same interface for both XALAN api and JAXP
TransformerFactory
http://xml.apache.org/xalan-j/apidocs/javax/xml/transform/TransformerFactory.html
http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/TransformerFactory.html
I thought, if I use XALAN's class instead of JAXP's class I can get
rid of this error.
For this I need to have a custom class loader.I tried to write the
Custom class loader. But I have failed in implementing so :-(
Plz help me resolve this issue.
Source code :
import java.io.* ;
import javax.xml.transform.* ;
import javax.xml.transform.stream.* ;
public class XSLCompiler1
{
public static void main ( String[] args )
throws Exception
{
try{
XSLCompiler1 app = new XSLCompiler1 () ;
app.transform ( "c:/eml.xsl") ;
}
catch(Throwable e)
{
System.out.println ( "Exception: " + e ) ;
StringWriter sw=new StringWriter();
PrintWriter pw=new PrintWriter(sw);
e.printStackTrace (pw) ;
System.out.println(sw);
}
}
/**
* 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.out.println ( "Exception: " + e ) ;
StringWriter sw=new StringWriter();
PrintWriter pw=new PrintWriter(sw);
e.printStackTrace (pw) ;
System.out.println(sw);
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.out.println(transformmedStream.toString());
}
private void usage ()
{
System.out.println ( "Usage: XSLCompiler1 <xsl_file>" ) ;
System.exit ( 1 ) ;
}
}
Exception Stack Trace :
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)
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
Re: Exception raised while compiling the XSL file using Translets
Posted by IndianAtTech <in...@gmail.com>.
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 if I don't specify xBootClassPath
And I want to avoid xBootClassPath params
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 14:53:47 +0530, IndianAtTech <in...@gmail.com> wrote:
> 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 <in...@gmail.com> 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"
> >
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
Re: Exception raised while compiling the XSL file using Translets
Posted by IndianAtTech <in...@gmail.com>.
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 if I don't specify xBootClassPath
And I want to avoid xBootClassPath params
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 14:53:47 +0530, IndianAtTech <in...@gmail.com> wrote:
> 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 <in...@gmail.com> 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"
> >
> >
> >
>
Re: Exception raised while compiling the XSL file using Translets
Posted by IndianAtTech <in...@gmail.com>.
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 <in...@gmail.com> 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"
>
>
>
Re: Exception raised while compiling the XSL file using Translets
Posted by IndianAtTech <in...@gmail.com>.
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 <in...@gmail.com> 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"
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org