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