You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Jason Rizer <ja...@yahoo.com> on 2002/02/26 23:25:37 UTC

xalan and jaxp compatibility

Hello,

I've recently written an application which includes a
simple transform.  Here is the code:


TransformerFactory tFactory =         
TransformerFactory.newInstance();

InputStream iss =   
getClass().getResourceAsStream("/cwmifimport.xsl");
Transformer transformer = 
   tFactory.newTransformer(new StreamSource(iss));

File sourceFile = new File("C:\\test.xml");
StreamSource source = new StreamSource(sourceFile);

File destFile = new File("C:\\dest.xml");
StreamResult result = 
    new StreamResult(new FileOutputStream(destFile));

transformer.transform(source, result);

Everything was working fine until I found out that
I've my stuff has to be interoperable with another of
our products which installs jaxp1.01.  When I try to
run with the jaxp1.01 jar files in my classpath (in
front of xalan.jar and xml-apis.jar) I get the
following exception:

javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerException:
org.xml.sax.SAXException: Namespace not supported by
SAXParser
	at
org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:767)
	at
JarGenericTest.doTransform(JarGenericTest.java:47)
	at JarGenericTest.main(JarGenericTest.java:26)

So, my question is:  Is there any way to work around
this problem and make my transform work with the
jaxp1.01 versions of jaxp.jar and parser.jar at the
front of my classpath?  On a related note, does anyone
remember whether jaxp1.01 included any xslt transform
support at all?  I seem to recall that it didn't but
can't find the documentation laying around on the net
anywhere.  Thanks in advance for any feedback anyone
might have.

-Jason

__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

RE: xalan and jaxp compatibility

Posted by Gary L Peskin <ga...@firstech.com>.
The problem is probably in parser.jar.  It probably contains an old XML
parser that does not support namespaces.  Can you remove that parser
from your classpath or at least place it after xerces.jar or
xercesImpl.jar?

Gary

> -----Original Message-----
> From: Jason Rizer [mailto:jasonriz@yahoo.com] 
> Sent: Tuesday, February 26, 2002 2:26 PM
> To: xalan-j-users@xml.apache.org
> Subject: xalan and jaxp compatibility
> 
> 
> Hello,
> 
> I've recently written an application which includes a
> simple transform.  Here is the code:
> 
> 
> TransformerFactory tFactory =         
> TransformerFactory.newInstance();
> 
> InputStream iss =   
> getClass().getResourceAsStream("/cwmifimport.xsl");
> Transformer transformer = 
>    tFactory.newTransformer(new StreamSource(iss));
> 
> File sourceFile = new File("C:\\test.xml");
> StreamSource source = new StreamSource(sourceFile);
> 
> File destFile = new File("C:\\dest.xml");
> StreamResult result = 
>     new StreamResult(new FileOutputStream(destFile));
> 
> transformer.transform(source, result);
> 
> Everything was working fine until I found out that
> I've my stuff has to be interoperable with another of
> our products which installs jaxp1.01.  When I try to
> run with the jaxp1.01 jar files in my classpath (in
> front of xalan.jar and xml-apis.jar) I get the
> following exception:
> 
> javax.xml.transform.TransformerConfigurationException:
> javax.xml.transform.TransformerConfigurationException:
> javax.xml.transform.TransformerException:
> org.xml.sax.SAXException: Namespace not supported by
> SAXParser
> 	at
> org.apache.xalan.processor.TransformerFactoryImpl.newTransform
> er(TransformerFactoryImpl.java:767)
> 	at
> JarGenericTest.doTransform(JarGenericTest.java:47)
> 	at JarGenericTest.main(JarGenericTest.java:26)
> 
> So, my question is:  Is there any way to work around
> this problem and make my transform work with the
> jaxp1.01 versions of jaxp.jar and parser.jar at the
> front of my classpath?  On a related note, does anyone
> remember whether jaxp1.01 included any xslt transform
> support at all?  I seem to recall that it didn't but
> can't find the documentation laying around on the net
> anywhere.  Thanks in advance for any feedback anyone
> might have.
> 
> -Jason
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Greetings - Send FREE e-cards for every occasion! 
http://greetings.yahoo.com