This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Provider for javax.xml.transform.TransformerFactory cannot be found


> I get this Error Message when i start my programm.
>
The message is presumably coming from the call on
TransformerFactory.newInstance().

I don't know specifically why you're getting it, but it looks to me as if,
for some reason, the TransformerFactory that you've successfully loaded from
the classpath, is trying to load a TransformerFactory implementation that
isn't loadable. So there's something missing from your classpath.

As for the rest of your logic, if you're controlling the transformation from
Java, I wouldn't normally use "getAssociatedStylesheet" which relies on
identifying the stylesheet from the <?xml-stylesheet?> processing
instruction in the source XML document; I would identify the stylesheet and
the source document separately from the Java code. But of course that
depends on your application requiremetns. If you do use
getAssociatedStylesheet you'll probably need to use setSystemId() so that
the system knows the URI of the source document, so it can resolve any
relative URI referring to the stylesheet.

Mike Kay

>
> What i try do do is to use the Transformer with
> ByteArray-Streams. Should
> this work?
> ....
> ....
> byte[] buffer = new byte[65535];
> ByteArrayOutputStream bout = new ByteArrayOutputStream();
> ....
> TransformerFactory tFactory = TransformerFactory.newInstance();
> Source stylesheet = tFactory.getAssociatedStylesheet(new
> StreamSource(new
> ByteArrayInputStream(buffer)), media,title,charset);
> Transformer transformer = tFactory.newTransformer(stylesheet);
> transformer.transform(new StreamSource(new
> ByteArrayInputStream(buffer)),
>                       new StreamResult(bout));
> ....
> ....
> Result: Provider for javax.xml.transform.TransformerFactory
> cannot be found
>
> I have tried it with Test-Files instead of the
> ByteArrayStreams but the
> result was the same.
>
> I use xerces.jar, xml-apis.jar (xalan-j_2_2_D14)
>
> English is not my language, so maybe i have misunderstood something
> important. Is the TransformerFactory a solution for my
> problem? Should i use
> something else? oder is my problem only the result of my bad design?
>
> Thanks a lot
>
> Regards, Reto
> Switzerland
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]